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

The min-nights modifiers should get cleared according to the previous prop value not the new one #994

Merged
merged 1 commit into from
May 8, 2018

Conversation

majapw
Copy link
Collaborator

@majapw majapw commented Feb 1, 2018

In addition, we don't seem to be removing the blocked modifier from these days at all. Whoops!

Here is a gif of the bug in action (not this only happens when you change the min nights value from a bigger value to a smaller value).
min_nights

Now we will remove min nights blocking according to the previous value and also, any time the value changes (and reapply it for new >0 values).

to: @amhunt @ljharb @erin-doyle

@majapw majapw force-pushed the maja-clear-min-nights-on-demand branch from 2781b68 to 2277896 Compare February 1, 2018 22:05
@coveralls
Copy link

coveralls commented Feb 1, 2018

Coverage Status

Coverage increased (+0.009%) to 84.832% when pulling 7b6b04b on maja-clear-min-nights-on-demand into 86cde2f 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.

Without a regression test, I'm not really sure why this was broken nor why this fixes it; no objection to it tho.

@erin-doyle
Copy link
Collaborator

👍 on a little more detail and test(s).

@majapw majapw force-pushed the maja-clear-min-nights-on-demand branch from 2277896 to 729675b Compare May 7, 2018 18:14
@majapw majapw force-pushed the maja-clear-min-nights-on-demand branch from 729675b to 7b6b04b Compare May 7, 2018 18:22
@majapw
Copy link
Collaborator Author

majapw commented May 7, 2018

I added some regression tests! Please take a look @ljharb

const startDate = today;
const focusedInput = START_DATE;
const minimumNights = 5;
const wrapper = shallow(<DayPickerRangeController
Copy link
Member

Choose a reason for hiding this comment

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

fwiw, the linter will soon require:

const wrapper = shallow((
  <DayPickerRangeController
    startDate={startDate}
    focusedInput={focusedInput}
    minimumNights={minimumNights}
  />
));

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we'll have to do a wholesale change of... most tests at that point. 😬

@ljharb ljharb added the semver-patch: fixes/refactors/etc Anything that's not major or minor. label May 7, 2018
Copy link
Contributor

@amhunt amhunt left a comment

Choose a reason for hiding this comment

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

Nice ! Looks good :)

@majapw majapw merged commit 4027557 into master May 8, 2018
@majapw majapw deleted the maja-clear-min-nights-on-demand branch May 8, 2018 05:05
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.

None yet

5 participants