-
Notifications
You must be signed in to change notification settings - Fork 842
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
[EuiDatePicker] Fix year dropdown when using minDate
or maxDate
#5069
Conversation
minDate
or `maxDateminDate
or maxDate
Preview documentation changes for this PR: https://eui.elastic.co/pr_5069/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man, if I had known I could update the react-datepicker package in #5000 ... 😆
Whelp you uncovered a style change that I didn't afford for in the Amsterdam styles. Can you update the following styles:
.react-datepicker__year-dropdown-container>div:not([class*='read-view']),
.react-datepicker__month-dropdown {
- height: 100%;
- height: 250px;
+ max-height: 250px;
}
This will fix the height of the year dropdown when there are only a few options. And so may be a good case to add a specific example for?
And then I just found another stylistic issue for when a day is selected & disabled
and in range & disabled
.
Which, btw, should the input be showing invalid
when a date is selected outside of the allowed min/max?
I pushed you a fix for those style issues |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5069/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5069/ |
The error state is configurable by the consumer. In that example |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5069/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5069/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Functionally and stylistically! Thanks!
Preview documentation changes for this PR: https://eui.elastic.co/pr_5069/ |
Summary
Closes #5058, closes #4219, and closes #2816, all of which were caused by a
display: none;
rule that accidentally targeted the wrong element whenminDate
and/ormaxDate
were configured.The fix was to "remove" the elements that were hidden by custom styles, and also remove the custom styles that were having unintended consequences (i.e., hiding the min and max years in the dropdown).
See the comment about why I left some code in, but I'd be willing to delete the code now if preferred.
Checklist
- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Props have proper autodocs and playground toggles- [ ] Checked Code Sandbox works for the any docs examples- [ ] Added or updated jest tests