-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Context menu snaps to top left corner in React 18 Strict Mode #5503
Comments
This is caused by our usage of |
I tried this out with @blueprintjs/core v5.0.0-alpha.4 in this code sandbox, and it appears to still be a bug. There are two strict mode errors:
|
Note that this is still an issue after one Popover React 18 related fix in #6458 |
Still an issue after the core v5.9.0 Overlay2 migration & Portal no longer using legacy context in React 18: https://codesandbox.io/p/devbox/sad-carlos-dc2ddx |
Is there any workaround? just turn off strict mode? |
keywords: ContextMenu, positioning, absolute, ContextMenu2, Popover2
Environment
"@blueprintjs/core": "4.8.0",
"@blueprintjs/popover2": "1.5.1",
Code Sandbox
Link to a minimal repro (fork this code sandbox): https://codesandbox.io/s/blueprint-sandbox-forked-ns061c?file=/src/index.tsx
Steps to reproduce
When you right click on the box now, the expected behavior is shown: the context menu is spawned where your
cursor is.
When you right click on the box now, another behavior is shown. The context menu is spawned in the top left corner of the page.
Actual behavior
The context menu is placed in the top-left corner of the page.
Expected behavior
The context menu should be placed directly under the mouse cursor.
Possible solution
The only workaround I have found yet is to disable StrictMode for the parts where a context menu should be.
The text was updated successfully, but these errors were encountered: