-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
BUGFIX: Limit click-outside handling for dialogs to their semi-transparent overlay #3492
Conversation
f7918ca
to
bfd2024
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works great with mouse clicks! But if i press the escape (esc) key on my keyboard, it closes all overalys. Can we intercept the escape key as well?
Very good point! I'll take a look at that :) |
Well, interesting: I looked at the Escape-Key handling for the dialogs and found that since 2018 Yet, somehow
|
you deserve a medal for b13d470 ;) we definitely make sure that this doesnt happen with esbuild (despite the different import syntax, but didnt think the webpack stack had any obvious flaws like this one ^^) Some modules referred to the components via import { /* ... */ } from '@neos-project/react-ui-components'; This caused webpack to pull the components from The solution was to change those reference to an explicit: import { /* ... */ } from '@neos-project/react-ui-components/src'; Now the |
This was more than I thought :) My plan was to have some global entity that can ensure a global order of stacked dialogs and close them in LIFO order when the escape-key is hit. Plan didn't work at first try, because it turned out that webpack was bundling the react-components twice. Plugins would receive a different version of the components than the main UI - thus also a different version of the global stack-management entity. So, I looked into that... Problem was that some modules in the codebase referred to the components via import { /* ... */ } from '@neos-project/react-ui-components'; This caused webpack to pull the components from '@neos-project/react-ui-components/lib-esm' rather than '@neos-project/react-ui-components/src', leading to the component modules being bundled twice. The solution was to change those references to an explicit: import { /* ... */ } from '@neos-project/react-ui-components/src'; Now the With that, I introduced the I then proceeded to also remove After this, Long story short:
Yep, that works now :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the improvements! Everything works as expected 💙
packages/neos-ui-ckeditor5-bindings/src/EditorToolbar/LinkButton.js
Outdated
Show resolved
Hide resolved
Some modules referred to the components via ```js import { /* ... */ } from '@neos-project/react-ui-components'; ``` This caused webpack to pull the components from '@neos-project/react-ui-components/lib-esm' rather than '@neos-project/react-ui-components/src', leading to the component modules being bundled twice. The solution was to add an alias for '@neos-project/react-ui-components' to the root webpack config, so that the components are always pulled from 'src/' at build-time.
f221068
to
ca2e1ac
Compare
ca2e1ac
to
4f309a8
Compare
Sorry for being too lazy to test, but will this also affect the behavior of non-stacked dialogs? |
@bwaidelich I totally agree that #3531 needs to be addressed. Not sure whether this PR is the place to do so, though. |
Ah right, I didn't see that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ;) Works as expected!
fixes: #2925
The problem
As documented in #2925, our click-outside-handling for dialogs is a tiny bit too aggressive, which leads to problems with stacked dialogs.
The solution
I removed the
enhanceWithClickOutside
decorator from the<Dialog/>
-component and replaced its behavior with a simpleonClick
-handler that is limited to the semi-transparent overlay that surrounds every dialog.The other issue described in #2925 (overlays do not cover entire user interface) is being addressed over here: #3491
EDIT: Some more changes were necessary to apply the same behavior to when the escape key gets pressed. A detailed description of the reasoning behind those changes can be found in this comment: #3492 (comment)