Skip to content
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

Post scheduler: Cannot move to prev/next month #17042

Closed
mmtr opened this issue Aug 15, 2019 · 5 comments · Fixed by #17201
Closed

Post scheduler: Cannot move to prev/next month #17042

mmtr opened this issue Aug 15, 2019 · 5 comments · Fixed by #17201
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@mmtr
Copy link
Contributor

mmtr commented Aug 15, 2019

After upgrading to Gutenberg 6.3.0, I cannot move to the previous or next month when scheduling a post publish date. The date picker dialog is hidden after clicking on the navigation buttons:

Aug-15-2019 11-15-40

The issue is not reproducible in Gutenberg 6.2.0.

@mmtr mmtr added the [Type] Bug An existing feature does not function as intended label Aug 15, 2019
@mmtr
Copy link
Contributor Author

mmtr commented Aug 15, 2019

I wonder if this is a regression caused by #14851 cc @aduth

@youknowriad
Copy link
Contributor

I think the problem is related to #14851 but the fix shouldn't be to update how withFocusOutside work. I think there's an a11y bug where in some browsers, the focus is lost entirely when we switch months. Ideally, when switching months, the focus should:

  • Stay on the button we just clicked
  • Focus the first day of the shown month.

@talldan
Copy link
Contributor

talldan commented Aug 26, 2019

Tricky one to resolve as the button is handled internally to https://github.com/airbnb/react-dates ... this component in particular:
https://github.com/airbnb/react-dates/blob/master/src/components/DayPickerSingleDateController.jsx

It seems like a completely new dom tree is mounted for the date picker on every month change, which seems entirely unnecessary. Initially I thought this key prop might be one of the reasons for that, but removing it has no effect on the bug:

key={ `datepicker-controller-${ momentDate ? momentDate.format( 'MM-YYYY' ) : 'null' }` }

Did some digging in the issues and this seems like it might be relevant:
react-dates/react-dates#1006

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Aug 26, 2019

I confirmed using git bisect that this regression was introduced in #14851.

@getdave
Copy link
Contributor

getdave commented Aug 27, 2019

Does this PR to the withFocusOutside HOC fix it?

#17051

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants