-
Notifications
You must be signed in to change notification settings - Fork 81
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
Improve the reverse navigation order of focusable elements within KTable cells #840
base: develop
Are you sure you want to change the base?
Improve the reverse navigation order of focusable elements within KTable cells #840
Conversation
…ksh/kolibri-design-system into refactor-handlekeydown merging refactor-handlekeydown
@MisRob and @BabyElias , Please have a look at it. |
@shivam-daksh , The overall working looks nicee to me now. Thanks :) |
lib/KTable/index.vue
Outdated
getFocusableElements(cell) { | ||
if (!cell) return []; | ||
const selectors = 'button, a, input, select, textarea'; | ||
return Array.from(cell.querySelectorAll(selectors)); |
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.
About the use of querySelectorAll
here, I was actually having a little lag in the navigation behaviour when moving through the focusable elements - this reminded me of an earlier code review comment here. We were using querySelectorAll earlier as well, but it caused performance issues, so we shifted to getElementByTagname
and it had a very positive impact on the same. Can you update this code to make use of the previous getElementbyTagname logic? or maybe if there's any other conclusion you derive from that conversation about performance improvement- it is more than welcome. Thanks!
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.
@BabyElias, Thanks for noticing. I've changed it to getElementsByTagName
.
@BabyElias , I was thinking the same. Let's leave it to @MisRob what she decides. |
Thanks @shivam-daksh and @BabyElias. Since the first PR review is almost complete, I would recommend to wait until we finish QA and merge #804. Then @shivam-daksh you could rebase this PR on top of the latest |
Description
This pull request addresses an issue with the Shift+Tab key navigation behavior in the KTable component (follow-up to issue #795). Previously, pressing Shift+Tab to navigate backward through table cells did not follow the expected reverse order of focusable elements, leading to an unintuitive and confusing user experience.
Issue addressed
#837
Addresses #PR# HERE
#795
Before/after videos:
Before:
View actual behavior video
After:
View expected behavior video
Example:
Given a table with the following structure:
Row 1:
Row 2:
Expected Behavior:
Changes Made:
Changelog
Steps to Test:
(optional) Implementation notes
At a high level, how did you implement this?
Initially
focusCell
inupdateFocusState
method was causing diffculty in implementation of the ideal navigation. It can be tackled by introducing a third parameter inupdateFocusState
to check iffocusCell
is necessary or not.Code
Does this introduce any tech-debt items?
Testing checklist
Reviewer guidance
Comments