Callout immediatly closes on hover in FireFox
Environment Information
- Package version(s): 6.X
- Browser and OS versions: FireFox (tested on Windows 10 & OS X)
Please provide a reproduction of the bug in a codepen:
https://codepen.io/justdevelopment/pen/YzXGYQv
Click on the show Callout and see how it stays open. Then, move the entire thing down the page, open the Callout again and see how it will close when you hover over it.
Actual behavior:
When you have a div with a hidden (vertical) scrollbar, which becomes visible on hover, any Callout card that is lower on the page will close when you hover over it. Cards which are visible without scrolling down will stay open.
As far as I can tell with debugging, it seems like the onScroll event goes off in FireFox when the hidden scrollbar is shown. When I set preventDismissOnScroll to true, it will correctly stay open. However, we do quite like the behaviour of it closing on scroll and we would prefer not to set this option just for FireFox to work correctly.
Expected behavior:
I expect the Callout to stay open when I hover over it, regardless where it is on the page. The behaviour should be the same as in Chrome / Edge.
Priorities and help requested:
Are you willing to submit a PR to fix? No. I don't know how to fix this :-)
Requested priority: Normal
@justdevelopment Thank you for reaching out to us! And for already starting the investigation.
Based on your findings and what I see in the preventDismissOnScroll and CalloutContent.base.tsx, it seems like this is a Firefox problem especially since it doesn't repro in other browsers like Chrome/Edge. There's also no logic that says to dismiss on hover at all in this code. You might be able to handle this situation by passing in a custom onScroll - perhaps with some logic in it to do like a prevent dismiss on hover... but this isn't something we plan to add to Callout. Closing this as external (Firefox) but please feel free to ping us again if there's anything further.