-
Notifications
You must be signed in to change notification settings - Fork 841
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
React datepicker better responsive handling when inline #1820
Conversation
src/components/date_picker/super_date_picker/date_popover/_date_popover_content.scss
Outdated
Show resolved
Hide resolved
NM on those comments, forgot these were in the same folder, so it was easy. Cleaned them up. |
@cchaos This one's been sitting for awhile. Mind giving it a quick review? |
@cchaos I think ultimately for me the biggest thing is that the calendar is useful in a mobile situation. The time selector is nice to have when we have the space, but honestly is going to be very, very hard to scroll decently in a mobile application given the default number of results (48?). Given that, using the pure text input works perfectly fine here and will likely be faster for most than fiddling with a skinny scroll selector. I think if we wanted to get deeper into solving the issue, we'd likely want to replace these controls with actual Given all that. I look at this as simply a quick hotfix solution we can add today to avoid breaks (as your issue points out, it is actually broken right now, and the SDP is too wide) and make the current datepicker and super datepicker work today without too much fuss. |
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.
Can we change the first example to now show the time in the input? I keep thinking it's an error that I don't see a time select and you can't type in the input.
I actually think turning the time display off should be default since showing the time select is off by default.
The only thing more related to this PR is it looks like the calendar is not completely centered in the panel:
We should try to get this in. @snide Do you want me to finish up those last few items or will you have time to? |
@cchaos go for it. |
- Right arrow position - Selected & in-range style - Default `dateFormat` doesn’t include time since `showTimeFormat` is false by default
const horizontalRuleSnippet = `<EuiHorizontalRule size="quarter" />`; | ||
const horizontalRuleMarginSnippet = `<EuiHorizontalRule margin="xs" />`; | ||
const horizontalRuleSnippet = '<EuiHorizontalRule size="quarter" />'; | ||
const horizontalRuleMarginSnippet = '<EuiHorizontalRule margin="xs" />'; |
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.
Linter forced me to change these
@@ -217,7 +217,7 @@ | |||
&--next { | |||
@include datePicker__arrow; | |||
// Pixel value because of some padding on the icon | |||
right: 10px; | |||
right: 20px; |
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.
@@ -635,7 +635,7 @@ | |||
.react-datepicker__month--accessible:focus { | |||
background: $euiFocusBackgroundColor; | |||
|
|||
.react-datepicker__day--in-range { | |||
.react-datepicker__day--in-range:not(.react-datepicker__day--selected) { |
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.
@@ -280,11 +280,12 @@ EuiDatePicker.propTypes = { | |||
|
|||
EuiDatePicker.defaultProps = { | |||
adjustDateOnChange: true, | |||
dateFormat: 'MM/DD/YYYY hh:mm A', | |||
dateFormat: 'MM/DD/YYYY', |
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.
It didn't make sense that the default date format would show time when by default, showTimeSelect
is false. So I removed the time format just from this default value.
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.
I approve this now with the added changes I made. 😄
@snide I can't request you as a reviewer since you're the creator, but can do take a look at my changes? |
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
@thompsongl Can you actually check my last commit as well: 61d463e |
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.
Still looks good
This one is ready to merge after updating the CL, yeah? |
@thompsongl yep. ill update and get it merged. |
jenkins test this |
Summary
Fixes #1809
Also tried to make the overall
EuiSuperDatePicker
a little smaller so that it fits in smaller resolutions (it now matches the size of the calendar itself).Checklist
Any props added have proper autodocsThis was checked for breaking changes and labeled appropriatelyJest tests were updated or added to match the most common scenariosThis required updates to Framer X components