-
Notifications
You must be signed in to change notification settings - Fork 162
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
fix: Allow text selection in date picker and date range picker #3181
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3181 +/- ##
========================================
Coverage 96.40% 96.41%
========================================
Files 784 784
Lines 22144 22142 -2
Branches 7191 7594 +403
========================================
- Hits 21349 21348 -1
+ Misses 788 787 -1
Partials 7 7 ☔ View full report in Codecov by Sentry. |
@@ -168,11 +168,6 @@ const DatePicker = React.forwardRef( | |||
|
|||
baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']); | |||
|
|||
const handleMouseDown = (event: React.MouseEvent) => { |
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.
This was preventing text selection in date picker even after removing user-select: none
from the dropdown.
It was introduced 3.5 years ago in CR-49510605
with the justification to prevent an undesired focus ring from appearing when clicking the calendar, but I can't reproduce this today.
@@ -131,7 +131,6 @@ $calendar-header-color: awsui.$color-text-body-default; | |||
} | |||
|
|||
.label { | |||
user-select: text; |
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.
These two rules to override the parent's behavior are not necessary anymore
Description
Issue:
AWSUI-60182
In the case of dropdowns that contain only a list of selectable options (autosuggest, button dropdown, multiselect, select) it makes sense to disable text selection, but not necessarily for anything that the dropdown may contain, and in particular not for date pickers and date range pickers, where this is having undesired side effects. Therefore moving
user-select: none
from the dropdown component down to the options list component.How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.