-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooltips are displayed even when text is undefined #255
Comments
Regarding tooltips in the modal – this happens due to focus trapping since it the first focusable element inside the modal gets focused when it opens. What would be your expected behavior in that case? Would you expect the whole modal to get focused first as an "additional" element in the list of focusable elements or something else? |
Updated the Also do you have a reproduction case for the reactivity part? When testing it locally based on the state – it seems to work as expected Screen.Recording.2024-05-19.at.21.51.16.mov |
@blvdmitry I woud expect that the modal is focused as additional element. |
To keep you updated – this issue happens because of the implementation internals, where we rely on a multi-step state changes based on a reducer which trigger one after another in the react lifecycle. However media query changes happen based on the native event loop and we trigger some of the related reducer actions before React state gets updated. I'm planning to look into the positioning utility next and try to move as much logic as possible to sync vanilla js computations instead of waiting for useEffects to resolve in an attempt to address this. |
Actually found a simpler way to fix this even though it took some code refactoring just to understand the problem better. Going to resolve the modal bit tomorrow or the day after too and ship a new patch with this update Screen.Recording.2024-05-29.at.01.19.36.mov |
Tried multiple approaches and added a new Screen.Recording.2024-05-29.at.23.09.12.movYou can try it out in 2.11.11 and feel free to reply here or in a new issue in case there are any other suggestions regarding this thread |
Describe the bug
Tooltips are displayed even when text is undefined. Additionally, when I open a modal, the first tooltip is activated automatically.
To Reproduce
Create an isolated reproduction on the CodeSandox:
sandbox
Expected behavior
When text is undefined, empty string, or null, the tooltip should not be present on the screen.
When I open a modal, tooltips should not be visible until hovered over.
Screenshots
Environment:
P.S. I also noticed that
<Tooltip text="hello" active={reactiveValue}>
is not reactive.The text was updated successfully, but these errors were encountered: