-
Notifications
You must be signed in to change notification settings - Fork 1
Fix accessibility of icon-only buttons in ConversationsSidebar #155
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,7 @@ export function ConversationsSidebar({ | |
| onClick={onClose} | ||
| aria-label="Close chats panel" | ||
| > | ||
| × | ||
| <span aria-hidden="true">×</span> | ||
| </button> | ||
| </div> | ||
| )} | ||
|
|
@@ -221,8 +221,9 @@ export function ConversationsSidebar({ | |
| setConfirmDeleteId(conv.id); | ||
| }} | ||
|
Comment on lines
221
to
222
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current logic allows multiple conversations to enter the 'confirm delete' state if the user clicks delete on several items in quick succession. This can lead to a confusing user experience. Consider restricting the confirmation state to a single conversation at a time, or disabling other delete buttons while one is active. |
||
| title="Delete conversation" | ||
| aria-label={`Delete conversation: ${conv.title}`} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| > | ||
| × | ||
| <span aria-hidden="true">×</span> | ||
| </button> | ||
| )} | ||
| </> | ||
|
|
||
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.
The
onClick={onClose}handler assumes thatonCloseis always defined, but the prop is optional. This could result in a runtime error ifonCloseis not provided. To improve robustness, use a conditional invocation:onClick={onClose ?? (() => {})}oronClick={() => onClose?.()}.