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

DatePicker: Fix crash when navigating between months #31751

Merged
merged 2 commits into from
Jun 16, 2021
Merged

DatePicker: Fix crash when navigating between months #31751

merged 2 commits into from
Jun 16, 2021

Conversation

mirka
Copy link
Member

@mirka mirka commented May 12, 2021

Description

A bug was introduced in #29716 that causes a onMonthPreviewed is not a function crash when the prev/next month buttons are clicked in DatePicker (but not DateTimePicker).

This PR:

  • Adds a DatePicker story in Storybook for testing.
  • Fixes the component so it doesn't call the onMonthPreviewed prop function if it wasn't passed.

How has this been tested?

Both the DatePicker and DateTimePicker components in Storybook work as expected.

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to replicate the bug using the storybook without the non-storybook change, and confirmed the change fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants