You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, I think is pretty self explanatory what I want to achieve... which is
when I hover over an element, that is wrapped inside a <HelpTip><template #trigger>... the content of HelpTip should display as tooltip...
Works great.
Next thing I want is for any click action inside the <template #trigger> to close the tooltip - BUT STILL ALLOW the action to happen...
What actually happens...
if I have logic like this:
const hideTooltip = (event: Event) => {
if (event.target && (event.target as HTMLElement).closest(".trigger")) {
if (dropdownRef.value) {
dropdownRef.value.hide();
}
}
};
the action (click) executes but the TOOLTIP does not hide...
but if I do this
const hideTooltip = (event: Event) => {
if (event.target && (event.target as HTMLElement).closest(".trigger")) {
if (dropdownRef.value) {
dropdownRef.value.hide();
event.stopImmediatePropagation();
}
}
};
the tooltip hides, and obviously the click event does not get triggered :/
and this happens ONLY where inside I have a nested dropdown ... because If I have
<HelpTip>
<template #trigger>
<button @click="someaction">button text</button>
</template>
TEST
</HelpTip>
It works as it should, the click get's executed and the "TEST" tooltip gets displayed.
so clearly the Dropdown component is hijacking the click event propagation and not propagating it correctly?
Any Ideas on how to tackle this thing would be great!
So, I have this scenario (which is not uncommon)... (especially in submenu > menu) situations...
where SelectButton is
And HelpTip is:
Now, I think is pretty self explanatory what I want to achieve... which is
when I hover over an element, that is wrapped inside a
<HelpTip><template #trigger>
... the content of HelpTip should display as tooltip...Works great.
Next thing I want is for any click action inside the <template #trigger> to close the tooltip - BUT STILL ALLOW the action to happen...
What actually happens...
if I have logic like this:
the action (click) executes but the TOOLTIP does not hide...
but if I do this
the tooltip hides, and obviously the click event does not get triggered :/
and this happens ONLY where inside I have a nested dropdown ... because If I have
It works as it should, the click get's executed and the "TEST" tooltip gets displayed.
so clearly the Dropdown component is hijacking the click event propagation and not propagating it correctly?
Any Ideas on how to tackle this thing would be great!
Here are some simplified live examples
Normal button
Nested dropdown
The text was updated successfully, but these errors were encountered: