-
Notifications
You must be signed in to change notification settings - Fork 4.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
Enhance: Added close on outside click flag & updated save post panel #67327
base: trunk
Are you sure you want to change the base?
Enhance: Added close on outside click flag & updated save post panel #67327
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Mayank-Tripathi32! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
1 similar comment
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Thanks for attempting a fix. That said, I think the issue needs to be solved in a different way. The EntitiesSavedState component is shared between the "editor" package's panel and the modal in the "site editor". That said what's being shared is not the correct thing. You can see that |
Thank you for the clarification. Would it be all right for me to work on implementing the wrapper? I believe it should be straightforward to adjust the behavior, and I can open a new PR with the required changes. |
Sure. Feel free to give it a try. Thanks for your help. |
Attempt to resolve #67313
What?
This PR adds a flag to the useDialog component to disable the behavior of closing the dialog when clicking outside of it. It also updates the relevant save_post code to prevent closing the dialog when clicked in specific areas.
Why?
The issue occurs when clicking on the 'padding area' of the Entity saved modal dialog, causing the dialog to close unexpectedly.
Animated GIF to illustrate:
How?
A closeOnOutsideClick flag was added to the useDialog component. By default, this behavior is set to true, meaning the dialog will close when clicking outside. The save_post file has been updated to disable this behavior for the issue mentioned above.
Testing Instructions