mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(FloatingBubble): drag should not trigger click on child elements (#12201)
* fix(FloatingBubble): Drag does not trigger click on descendant elements * fix(FloatingBubble): Drag does not trigger click on descendant elements
This commit is contained in:
parent
c8e0f26bff
commit
0ad72d6757
@ -189,6 +189,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
const onClick = (e: MouseEvent) => {
|
const onClick = (e: MouseEvent) => {
|
||||||
if (touch.isTap.value) emit('click', e);
|
if (touch.isTap.value) emit('click', e);
|
||||||
|
else e.stopPropagation();
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -223,7 +224,7 @@ export default defineComponent({
|
|||||||
onTouchstartPassive={onTouchStart}
|
onTouchstartPassive={onTouchStart}
|
||||||
onTouchend={onTouchEnd}
|
onTouchend={onTouchEnd}
|
||||||
onTouchcancel={onTouchEnd}
|
onTouchcancel={onTouchEnd}
|
||||||
onClick={onClick}
|
onClickCapture={onClick}
|
||||||
style={rootStyle.value}
|
style={rootStyle.value}
|
||||||
v-show={show.value}
|
v-show={show.value}
|
||||||
{...attrs}
|
{...attrs}
|
||||||
|
1
packages/vant/src/vue-tsx-shim.d.ts
vendored
1
packages/vant/src/vue-tsx-shim.d.ts
vendored
@ -19,5 +19,6 @@ declare module 'vue' {
|
|||||||
interface HTMLAttributes {
|
interface HTMLAttributes {
|
||||||
onTouchmovePassive?: EventHandler;
|
onTouchmovePassive?: EventHandler;
|
||||||
onTouchstartPassive?: EventHandler;
|
onTouchstartPassive?: EventHandler;
|
||||||
|
onClickCapture?: EventHandler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user