Skip to content

fix: fixed focus flow issue on right arrow press #17317

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

Merged

Conversation

Gururajj77
Copy link
Contributor

Closes #17281

The bug mentioned in the above issue, shows that the expected behaviour of right arrow press on a focussed and a opened node should bring down to the first child of the opened node is missing. This has been fixed in this PR.

The reference to the behaviour is on our website's TreeView component page

Changelog

New

  • renamed ref to forwardRef to distinguish between our local ref
  • new setRefs function, which checks for forwardRef to say its a parent node or not
  • passed the setRefs to the li in the jsx

Changed

  • added some error handling to make sure that we don't have any console errors

Testing / Reviewing

  • open the deploy preview of the TreeView
  • in the default story, focus on the first item
  • navigate to a closed node which has more leaf nodes in it
  • press right arrow once, to see that the node opens
  • press right arrow once again, and the focus should move to the first child of the opened parent node.

@Gururajj77 Gururajj77 requested a review from a team as a code owner September 3, 2024 09:45
Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 53cf5ab
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66d6dabbd7dc81000887ebcd
😎 Deploy Preview https://deploy-preview-17317--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 53cf5ab
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66d6dabb3b67960008d1b4ae
😎 Deploy Preview https://deploy-preview-17317--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit fd35cea
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66d80b4650f9bb00087b9c49
😎 Deploy Preview https://deploy-preview-17317--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit fd35cea
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66d80b46feebb200087b2676
😎 Deploy Preview https://deploy-preview-17317--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! just a question about the comment removals

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding those tests!

@tay1orjones tay1orjones added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@alisonjoseph alisonjoseph added this pull request to the merge queue Sep 4, 2024
Merged via the queue into carbon-design-system:main with commit 13fe26e Sep 4, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: TreeNode error in keypress handler
4 participants