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

Address missing daypicker width when calendarMonthPadding theme variable is undefined #1355

Merged
merged 1 commit into from
Sep 13, 2018

Conversation

majapw
Copy link
Collaborator

@majapw majapw commented Sep 13, 2018

Fixes #1352

We added a new theme variable (horizontalMonthPadding) in v17.2.0. Unfortunately, when it was undefined, the effect was a trashfire (the daypicker width would be set to NaN). This PR addresses that edgecase and offers a fix!

to: @ljharb @noratarano @codylawson

@majapw majapw added the semver-patch: fixes/refactors/etc Anything that's not major or minor. label Sep 13, 2018
@coveralls
Copy link

coveralls commented Sep 13, 2018

Coverage Status

Coverage remained the same at 84.875% when pulling 8493c23 on maja-fix-daypicker-width-when-padding-is-NaN into f7fdc09 on master.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

What about when it’s null?

@majapw majapw force-pushed the maja-fix-daypicker-width-when-padding-is-NaN branch from f391158 to 8493c23 Compare September 13, 2018 17:23
@majapw
Copy link
Collaborator Author

majapw commented Sep 13, 2018

@ljharb I added a test case. :) Notably, 2 * null is 0 whereas 2 * undefined is NaN because Javascript math.

@ljharb
Copy link
Member

ljharb commented Sep 13, 2018

tbh I'm pleased with myself that I didn't know that off the top of my head

@majapw majapw merged commit 90c7506 into master Sep 13, 2018
@majapw majapw deleted the maja-fix-daypicker-width-when-padding-is-NaN branch September 13, 2018 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch: fixes/refactors/etc Anything that's not major or minor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date Picker width not being calculated
3 participants