Skip to content
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

[Bug]: ClickableTile double onKeyDown event #15028

Closed
2 tasks done
alewitt2 opened this issue Oct 26, 2023 · 0 comments · Fixed by #15029
Closed
2 tasks done

[Bug]: ClickableTile double onKeyDown event #15028

alewitt2 opened this issue Oct 26, 2023 · 0 comments · Fixed by #15029

Comments

@alewitt2
Copy link
Contributor

Package

@carbon/react

Browser

Chrome, Safari, Firefox, Edge

Package version

v11.40.0

React version

16.14.0

Description

when have defined an onKeyDown callback for clickableTile, and you click enter or space, it calls the callback 2 times.

i think its this line that is duplicating the call https://github.com/carbon-design-system/carbon/blob/main/packages/react/src/components/Tile/Tile.tsx#L167

Reproduction/example

https://stackblitz.com/edit/github-ubvput?file=src%2FApp.jsx

Steps to reproduce

  • in the Stackblitz, the @carbon/react template is a little broken, so you'll need to comment out the line in _sliders.scss thats preventing the project from running and then re-run the project with yarn dev

  • open the dev tools console

  • click on the webpage (not on the tile)

  • tab focus on the tile

  • press Enter or Space (this will bring you to a new webpage, just close the new tab)

  • look at the dev tools console and see that the event logged twice.

  • Assuming you are still focused on the tile, push any other key and see that it only fires 1 event.

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

IBM Cloud Satellite, Cloud PAL

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
1 participant