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

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

Merged
merged 3 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/components/CalendarDay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ class CalendarDay extends React.PureComponent {
}

onKeyDown(day, e) {
const {
onDayClick,
} = this.props;
const { onDayClick } = this.props;

const { key } = e;
if (key === 'Enter' || key === ' ') {
Expand Down Expand Up @@ -133,7 +131,6 @@ class CalendarDay extends React.PureComponent {
modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar,
hoveredSpan && styles.CalendarDay__hovered_span,
modifiers.has('selected-span') && styles.CalendarDay__selected_span,
modifiers.has('last-in-range') && styles.CalendarDay__last_in_range,
modifiers.has('selected-start') && styles.CalendarDay__selected_start,
modifiers.has('selected-end') && styles.CalendarDay__selected_end,
selected && styles.CalendarDay__selected,
Expand Down Expand Up @@ -254,14 +251,6 @@ export default withStyles(({ reactDates: { color, font } }) => ({
},
},

CalendarDay__last_in_range: {
borderStyle: 'solid',

':hover': {
borderStyle: 'solid',
},
},

CalendarDay__selected: {
background: color.selected.backgroundColor,
border: `1px double ${color.selected.borderColor}`,
Expand Down
8 changes: 1 addition & 7 deletions src/components/CustomizableCalendarDay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,7 @@ export const selectedSpanStyles = {
},
};

export const lastInRangeStyles = {
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

borderStyle: 'solid',

hover: {
borderStyle: 'solid',
},
};
export const lastInRangeStyles = {};

export const selectedStyles = {
background: color.selected.backgroundColor,
Expand Down