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

Remove last-in-range style modifiers to fix border issue #1538

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@krissalvador27
Copy link

krissalvador27 commented Feb 10, 2019

Fixes issue #1536

Before

  • Border top of last day in selected range is not selected color

screen shot 2019-02-08 at 3 37 04 pm

  • Border of the hovered day overlaps border of the last day in selected range

screen shot 2019-02-09 at 4 41 49 pm

After

  • Border top of last day in selected range is expected selected color

screen shot 2019-02-08 at 3 36 44 pm

  • Border of the hovered day no longer overlaps border of the last day in selected range

screen shot 2019-02-09 at 4 41 35 pm

  • Not sure if it's an issue (I don't think it is) but the border of the last in range day overlaps the border of the last day, making it appear 1 pixel smaller than the first day. It was previously fixed with PR #1328 but I think that surfaced the issue this PR fixes now.

@krissalvador27 krissalvador27 force-pushed the krissalvador27:remove-last-in-range-styles branch from bed5402 to 34ded9e Feb 10, 2019

@coveralls

This comment has been minimized.

Copy link

coveralls commented Feb 10, 2019

Coverage Status

Coverage remained the same at 84.504% when pulling 8f46272 on krissalvador27:remove-last-in-range-styles into 1a55d68 on airbnb:master.

@@ -2698,18 +2698,6 @@ describe('DayPickerRangeController', () => {
expect(modifiers.has('selected-span')).to.equal(true);
});

it('contains `last-in-range` if this.isLastInRange returns true', () => {

This comment has been minimized.

@ljharb

ljharb Feb 10, 2019

Member

The removal of this test indicates it’s a breaking change; can we avoid that?

This comment has been minimized.

@krissalvador27

krissalvador27 Feb 10, 2019

Author

I can revert the code deleted on this.modifier but keep the deleted last in range check and styles add that caused the issue

@krissalvador27

This comment has been minimized.

Copy link
Author

krissalvador27 commented Feb 11, 2019

@ljharb let me know if there's anything else you'd like me to do :)

@ljharb

ljharb approved these changes Feb 11, 2019

@@ -160,14 +159,6 @@ export const selectedSpanStyles = {
},
};

export const lastInRangeStyles = {

This comment has been minimized.

@ljharb

ljharb Feb 11, 2019

Member

to be really careful about breaking changes, we might want to keep this as export const lastInRangeStyles = {}

This comment has been minimized.

@nkinser

nkinser Feb 11, 2019

Contributor

I think making lastInRangeStyles = {} would fix the bug without needing to completely remove the modifier's styles. This would make it so that there is no built-in styling for lastInRange, thus fixing the bug, but you could still supply your own styles if you wanted to.

@ljharb ljharb requested review from majapw , monokrome and nkinser Feb 11, 2019

@krissalvador27 krissalvador27 force-pushed the krissalvador27:remove-last-in-range-styles branch from b98bbb5 to 8f46272 Feb 12, 2019

@krissalvador27

This comment has been minimized.

Copy link
Author

krissalvador27 commented Feb 12, 2019

@nkinser @ljharb Great catch! Removing lastInRangeStyles would have been a breaking change for sure. Made it an {} and rebased commits on master.

@ljharb

ljharb approved these changes Feb 12, 2019

@krissalvador27

This comment has been minimized.

Copy link
Author

krissalvador27 commented Feb 18, 2019

@majapw anything else needed to get this merged in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment