-
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
Keep post publishing popover open when a date is clicked #29738
Keep post publishing popover open when a date is clicked #29738
Conversation
Add a keepOpen prop to the DateTimePicker and keep focus on the date picker popover when true.
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @allilevine! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
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.
LGTM. Although it might be fixed straight in the react-dates library, it seems that we aren't going to get a fix. We can re-iterate and update the code later in case the issue is fixed there.
Also, we've been considering replacing the component with other choices.
I'd like to know the opinion of other folks, too.
This PR fixes the issue, which is nice.
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.
This looks sensible, I'm giving this a thumbs up 👍🏻
Looks good, thanks for working on this, I renamed the PR to make it a bit more user-oriented, as the title ends up in the changelog for the release. |
I opened a follow-up issue to fix the popover position changing as the date changes: #29899 |
Description
Add a keepOpen prop to the DateTimePicker and keep focus on the date picker popover when true.
This isn't an ideal solution, given the note to remove
keepFocusInside()
, but removing it would require either changes to react-dates or replacing react-dates.react-dates
issue to keep focus after user changes month: Body gets focus after user changes month with mouse click react-dates/react-dates#1065isFocused
we can pass to<DayPickerSingleDateController>
, but the focus doesn't persist after transitioning to a different month.To do: Open a follow-up issue to fix the popover changing position as the date changes (the popover position is relative to the publish date width).
Fixes #24206
How has this been tested?
Screenshots
Gif of the popover staying open after clicking on a date:
Types of changes
Bug fix: adds a
keepOpen
prop toDateTimePicker
and useskeepFocusInside()
to keep the popover open when true.Checklist: