-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ResourceList onClick is called three times on keypress of Enter #1188
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
ResourceList onClick is called three times on keypress of Enter #1188
Conversation
@chloerice This should be good to go now :) |
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.
Left a few small comments, with a squash this should be 👍 . 🎩 and everything looked 👌
src/components/ResourceList/components/Item/tests/Item.test.tsx
Outdated
Show resolved
Hide resolved
src/components/ResourceList/components/Item/tests/Item.test.tsx
Outdated
Show resolved
Hide resolved
Co-Authored-By: alex-page <alex@alexpage.com.au>
Co-Authored-By: alex-page <alex@alexpage.com.au>
What's the status on this PR @alex-page, does it need another round of review? |
I need to tweak the changes Andrew suggested. Should be ready tomorrow. Thanks for the bump! |
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.
LGTM 👍 You'll want to rebase to squash the commits/resolve conflicts, good luck 😄
WHY are these changes introduced?
Resolves #1179
Resolves https://github.com/Shopify/web/issues/11580
WHAT is this pull request doing?
This pull request stops
onClick
firing three times. The three events happened because:onClick
was only meant to be fired when the resource list item had an anchor tagHow to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
The below code can be tested by tabbing to the first item which is an anchor and making sure that on enter key press the number increases in the title. The second item should also only increment the amount by one when key pressing enter.
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist