-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix/bug useTablist #5996 #6023
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/bug useTablist #5996 #6023
Conversation
Thanks for the PR! To answer some of your questions from the Issue, it should be your Github login for the CLA. It would also appear that you have prettier or some auto formatted enabled because some files changed which I don't think you meant to change. It would be good to revert all the unrelated style changes so we can focus on the actual changes for the PR. You can see how each of the ci steps are run by looking in the circle config file, package.json, and makefile. As for getting them to pass, if you look at the test that failed, you'll see that we're testing for the bad behavior
|
Thanks for helping me. I will fix my code |
GET_BUILD |
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.
Thanks for the PR! I'm double checking the behavior we want here via #5996 (comment) so we'll be holding off on any further changes until we can confirm that.
As an aside, if this is indeed the behavior we want, we'll also need to modify useSelectableCollection to only conditionally prevent default behavior on various keydown events. As it is now, the changes in this PR actually aren't sufficient to allow ArrowUp/Down to scroll the page when the TabList's orientation is 'horizontal'
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'any' } |
|
Better to just not preventDefault when we aren't actively handling that key and let the browser do its thing. It may not be the window which needs to scroll. It could be any ancestor.
|
e.preventDefault(); | ||
// allowing default behavior for above and below key | ||
if (!delegate.getKeyAbove || !delegate.getKeyBelow) { | ||
e.preventDefault(); | ||
} |
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.
since this is in the if (e.altKey && e.key === 'Tab') {
statement, this won't actually have the desired effect of allowing default behavior if the the delegate returns null from getKeyAbove/getKeyBelow. You'll want to look at the cases in the switch statement like here:
e.preventDefault(); |
e.preventDefault
not be called if nextKey
is null I imagine.
I just wanted to pop in and let you know that the team might be slow to review as we work on some other priorities. We appreciate your understanding and apologize for the wait. |
No no its okk , I also had my exams and I am still learning, I am willing to wait |
Update on comment #6023 (review) from above here: #5996 (comment) |
8cb1a5d
to
3013156
Compare
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.
Verified that ArrowUp/Down still have browser default behavior when navigating a horizontally oriented TabList but ArrowUp/Down/Left/Right all still shift the Tab selection for vertical tabs. Thanks for the contribution!
* Translations for TagGroup * add number of tags * Revert " fix/bug useTablist #5996 (#6023)" This reverts commit c4a783e. * Revert "Extract `ToggleStateProps` type to use only what is needed in `useToggleState` (#3836)" This reverts commit 81e3804. --------- Co-authored-by: Daniel Lu <dl1644@gmail.com>
* Update Picker placeholder to be shorter (#6796) * feat: Support fragments in collections (#6430) Co-authored-by: Reid Barber <reid@reidbarber.com> Co-authored-by: Robert Snow <rsnow@adobe.com> * Exposing prop disabledBehavior to TableView (#6832) * fix/bug useTablist #5996 (#6023) * fix/bug useTabist #5996 and added tests * Extract `ToggleStateProps` type to use only what is needed in `useToggleState` (#3836) * Extract `ToggleStateProps` type to use only what is needed in `useToggleState` --------- Co-authored-by: Robert Snow <rsnow@adobe.com> Co-authored-by: solimant <solimant@users.noreply.github.com> Co-authored-by: Kyle Taborski <ktabors@yahoo.com> Co-authored-by: Medhashis Maiti <129734281+mdhmaiti@users.noreply.github.com> Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Closes #5996
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project:
Added the horizontal orientations in the TabsKeyboardDeligate to prevent moving of tabs using upper and lower arrow keys