Skip to content

Commit 8d54857

Browse files
committed
Tooltip: early return hide() & show() if disabled
To prevent those function from being executed anyway (onClick for example) when the tooltip is disabled.
1 parent 9a1d0eb commit 8d54857

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/Tooltip/Tooltip.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,12 @@ export default defineComponent({
166166
});
167167
168168
function show() {
169+
if (props.disabled) return;
169170
tooltipToggled.value = true;
170171
}
171172
172173
function hide(force: boolean = false) {
174+
if (props.disabled) return;
173175
tooltipToggled.value = false;
174176
if (tooltipTrigger$.value) tooltipTrigger$.value.blur();
175177
if (!force) return;

0 commit comments

Comments
 (0)