-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The strange behaviour was only observed in Mozilla Firefox (Chrome, Safari and Microsoft Edge work fine).
I have a table with multiply rows and multiply tooltips. Sometimes the onMouseleave event doesn't fire and most of the time I can see multiple tooltips when moving the mouse quickly. You can see this behaviour in the gif below.
Code
const handleOnMouseEnter = () => {
if (id === 'column8') {
console.log('OnMouseEnter');
}
};
const handleOnMouseLeave = () => {
if (id === 'column8') {
console.log('OnMouseLeave');
}
};
const [isOver, hoverProps] = useHover({ delayEnter: 400 });
const { renderLayer, triggerProps, layerProps } = useLayer({
isOpen: isOver,
container: getPortalElement('TooltipPortal'),
overflowContainer: true,
placement,
possiblePlacements: [
'top-start',
'top-end',
'top-center',
],
snap: true,
triggerOffset: 4,
auto: true,
});
const layer = isOver
? renderLayer(
<StyledTooltip {...layerProps} role="tooltip">
{tooltip}
</StyledTooltip>
)
: null;
return (
<StyledTooltipDecorator
{...triggerProps}
{...hoverProps}
onMouseEnter={handleOnMouseEnter}
onMouseLeave={handleOnMouseLeave}
id={id}
>
{layer}
</StyledTooltipDecorator>
);
};
Expected behavior
onMouseleave should fire every time
Browser / OS (please complete the following information):
- OS: MacOC
- Browser Mozilla Firefox
- Version 100
Additional context
When I inspected the console output, I noticed that the event mouseleave
does not fire when I move the mouse quickly, mouseenter
event fires always.
I'm not exactly sure that the problem is associated with react-laag
. Any help is greatly appreciated.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working