We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc26ab9 commit 77cbcccCopy full SHA for 77cbccc
1 file changed
src/components/ContextOverlay/ContextOverlay.tsx
@@ -60,14 +60,22 @@ export const ContextOverlay = ({
60
if (swapDelay.current) {
61
clearTimeout(swapDelay.current);
62
}
63
+
64
+ const replacePlaceholder = () => {
65
+ eventMemory.current = ev.type as "mouseenter" | "focusin" | "click";
66
+ setPlaceholder(false);
67
+ };
68
69
+ if (waitForClick) {
70
+ replacePlaceholder();
71
+ return;
72
+ }
73
74
swapDelay.current = setTimeout(
- () => {
- eventMemory.current = ev.type as "mouseenter" | "focusin" | "click";
- setPlaceholder(false);
- },
75
+ replacePlaceholder,
76
// we delay the swap for hover/focus to prevent unwanted effects
77
// (e.g. event hickup after replacing elements when it is not really necessary)
- waitForClick ? 0 : swapDelayTime
78
+ swapDelayTime
79
);
80
};
81
0 commit comments