Skip to content

Commit

Permalink
feat(Tooltip): allow onClose without timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi authored and kelsos committed Aug 5, 2024
1 parent f3c1399 commit 9406782
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/composables/popper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function usePopper(options: Ref<PopperOptions>, disabled: Ref<boolean> =
get(instance)?.update();
};

const onOpen = () => {
const onOpen = (immediate = false) => {
if (get(disabled))
return;

Expand All @@ -86,13 +86,13 @@ export function usePopper(options: Ref<PopperOptions>, disabled: Ref<boolean> =
const timeout = setTimeout(() => {
set(open, true);
set(openTimeout, undefined);
}, get(openDelay));
}, immediate ? 0 : get(openDelay));

set(openTimeout, timeout);
}
};

const onClose = () => {
const onClose = (immediate = false) => {
if (get(disabled))
return;

Expand All @@ -108,7 +108,7 @@ export function usePopper(options: Ref<PopperOptions>, disabled: Ref<boolean> =

set(open, false);
set(closeTimeout, undefined);
}, get(closeDelay));
}, immediate ? 0 : get(closeDelay));

set(closeTimeout, timeout);
}
Expand Down

0 comments on commit 9406782

Please sign in to comment.