chore(ext): rm keydown event on history#321
Merged
gaomeng1900 merged 1 commit intomainfrom Mar 20, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the keyboard keydown handler from the History list item interaction.
Changes:
- Removed
onKeyDownhandling forEnter/Spaceactivation on history items.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -98,12 +98,6 @@ export function HistoryList({ | |||
| role="button" | |||
| tabIndex={0} | |||
| onClick={() => onSelect(session.id)} | |||
There was a problem hiding this comment.
Removing the onKeyDown handler breaks keyboard activation for an element using role=\"button\" + tabIndex={0} (Enter/Space will no longer trigger selection). To keep this accessible, either restore the Enter/Space key handling, or change the element to a semantic <button type=\"button\"> (and then you can drop role/tabIndex and rely on native keyboard behavior).
Suggested change
| onClick={() => onSelect(session.id)} | |
| onClick={() => onSelect(session.id)} | |
| onKeyDown={(event) => { | |
| if (event.key === 'Enter' || event.key === ' ') { | |
| event.preventDefault() | |
| onSelect(session.id) | |
| } | |
| }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ATT
Type
Requirements / 要求