-
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
Changes from 7 commits
8c94040
061c560
c954775
3529f7b
1c1a95f
34f6559
e866c26
61d463e
d181c5e
5157c2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
height: $euiSize; | ||
width: $euiSize; | ||
transform: rotate(-90deg); | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
border-top-color: $euiFocusBackgroundColor; | ||
border-bottom-color: $euiFocusBackgroundColor; | ||
} | ||
|
@@ -661,6 +661,14 @@ | |
|
||
// We drop the time picker on mobile. They can still type in the time directly. | ||
@include euiBreakpoint('xs','s') { | ||
|
||
// This resizes EUI's normal form control to be the width of the calendar | ||
.euiDatePicker--inline { | ||
max-width: $euiDatePickerCalendarWidth; | ||
display: block; | ||
} | ||
|
||
// This hides the time entirely | ||
.react-datepicker__time-container { | ||
display: none; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Uses some form mixins | ||
@import 'variables'; | ||
@import 'date_picker'; | ||
@import 'date_picker_range'; | ||
@import 'super_date_picker/index'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$euiDatePickerCalendarWidth: 284px; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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, |
||
fullWidth: false, | ||
isLoading: false, | ||
shadow: true, | ||
shouldCloseOnSelect: true, | ||
showIcon: true, | ||
showTimeSelect: false, | ||
timeFormat: 'hh:mm A', | ||
}; |
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