-
Notifications
You must be signed in to change notification settings - Fork 831
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
[EuiSuperDatePicker] Allow setting absolute dates without Enter key #7732
Merged
cee-chen
merged 14 commits into
elastic:main
from
sakurai-youhei:absolute-dates-without-enter
May 8, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e0ff1d5
Allow setting absolute dates without Enter key on EuiSuperDatePicker
sakurai-youhei cd4f818
Add clearTimeout call in componentWillUnmount
sakurai-youhei 766d18c
Add a test and change how to mock setTimeout
sakurai-youhei ae5f15a
Remove unnecessary block
sakurai-youhei 97eb9c0
Add changelog
sakurai-youhei 825eec7
Add an extra trigger for touch devices
sakurai-youhei 1fd3e5a
Update changelog
sakurai-youhei f846a75
Change when and how to delay to set true to isTextInvalid
sakurai-youhei ebc0858
Remove unnecessary mocks
sakurai-youhei e094204
Merge branch 'main' into absolute-dates-without-enter
cee-chen 6c10654
Revert current changes
cee-chen 5564a79
Show conditional submit button icon instead of helptext
cee-chen 7253811
[PR feedback] Align form row help/error text to full width of flex group
cee-chen 9b30953
[PR feedback] remove conditional button color
cee-chen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Updated `EuiSuperDatePicker`'s absolute tab UX to support setting manual timestamps via mouse click as well as enter key |
31 changes: 13 additions & 18 deletions
31
src/components/date_picker/super_date_picker/date_popover/_absolute_tab.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
.euiSuperDatePicker__absoluteDateFormRow { | ||
.euiSuperDatePicker__absoluteDateForm { | ||
padding: 0 $euiSizeS $euiSizeS; | ||
} | ||
|
||
/* A bit of a visual trickery to make the format "hint" become an "error" text. | ||
NOTE: Normally reordering visually (vs DOM) isn't super great for screen reader users, | ||
but as the help text is already read out via `aria-describedby`, and the error text | ||
is read out immediately via `aria-live`, we can fairly safely prioritize visuals instead */ | ||
.euiFormRow__fieldWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
}; | ||
|
||
.euiFormControlLayout { | ||
order: 0; | ||
} | ||
.euiSuperDatePicker__absoluteDateFormSubmit { | ||
flex-shrink: 0; | ||
} | ||
|
||
.euiFormHelpText { | ||
order: 1; | ||
} | ||
.euiSuperDatePicker__absoluteDateFormRow { | ||
flex-grow: 1; | ||
|
||
.euiFormErrorText { | ||
order: 2; | ||
// CSS hack to make the help/error text extend to the submit button. | ||
// We can't actually put the submit button within an EuiFormRow due to | ||
// cloneElement limitations (https://github.com/elastic/eui/issues/2493#issuecomment-561278494) | ||
// TODO: Remove this and clean up DOM rendering once we can | ||
.euiFormRow__text { | ||
margin-inline-end: -1 * ($euiSizeXL + $euiSizeS); // XL - size of the button, S - size of the flex gap | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would it make sense to show the help text, regardless if the date is parsed or unparsed? It could be useful for users to see the accepted formats prior to making any 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.
I think I have a slight preference to not showing it until needed? TBH, I do wonder how many people even use the absolute input, and it's kind of a lot of information to show 🙈