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:
ShuGang Zhou 2023-08-18 16:08:40 +08:00 committed by GitHub
parent c8e0f26bff
commit 0ad72d6757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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}

View File

@ -19,5 +19,6 @@ declare module 'vue' {
interface HTMLAttributes { interface HTMLAttributes {
onTouchmovePassive?: EventHandler; onTouchmovePassive?: EventHandler;
onTouchstartPassive?: EventHandler; onTouchstartPassive?: EventHandler;
onClickCapture?: EventHandler;
} }
} }