-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[pickers] Add PageUp
and PageDown
support for time components
#14812
Merged
arthurbalduini
merged 10 commits into
mui:master
from
arthurbalduini:page-up-page-down-events-support
Oct 10, 2024
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2a9e0e3
add pageUp and pageDown cases for Clock component
arthurbalduini ecb3053
Removes unused isFocused prop and use isSelecte instead
arthurbalduini 85040e0
implement key support for DigitalClock and MultiSectionDigitalClock
arthurbalduini ef8abf4
implement tests
arthurbalduini b83f10e
Revert "Removes unused isFocused prop and use isSelecte instead"
arthurbalduini 9bcef8d
improves readability
arthurbalduini 7b421b0
refactor tests to be closer to real user behavior
arthurbalduini 36fed6b
null safety approach for child to focus
arthurbalduini cbb7216
adds jsDocs for getFocusedListItemIndex
arthurbalduini 5355f67
rely on active element on tests
arthurbalduini 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
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
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
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.
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.
This code is impossible to reach?
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.
In theory
listRef.current
can be null, so this is meant to assure null safety on the lines below (and prevent TS complaints 😅)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.
Only if the ref is not applied to the right element. This sounds unlikely to happen in a future refactoring, not with our test suite.
I think that using
listRef.current!
so it gets transpiled tolistRef.current
is much better. No extra bundle size or runtime time spent on this. If done at scale, I would hope this brings more than a +1% improvement.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.
That was my suggestion to go the safer route and prevent cases where DOM could be tampered with.
But given most other cases, where
<x>Ref.current
is accessed, we could indeed simplify tolistRef.current!
.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.
Makes sense ! I will add it to this PR
Thanks for the suggestion 🙏