-
Notifications
You must be signed in to change notification settings - Fork 69
Add title attribute to chat input button #2935
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
Open
greggb
wants to merge
2
commits into
main
Choose a base branch
from
gb.add-title-to-chat-input-button
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lg-chat/input-bar': patch | ||
--- | ||
|
||
Add an accessible title to the submit button |
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
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
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.
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.
According to this page, I think it's saying that the aria-label does not have to match the contents of the button, but it should contain it.
So something like the following would be considered accessible, since the visible label
Enter
is present within thearia-label
:Additionally, since the button can sometimes render as an icon-only button,
aria-label
would be beneficial overtitle
sincearia-label
provides a text label for elements that might not have a visible one, whiletitle
is more for additional context.Given that the button may include or exclude visible text, relying on
aria-label
seems like the most robust and accessible solution.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.
Thanks @shaneeza - Is
Enter Message
the right label for a submit button? This seems like a good compromise, but in isolation it sounds like the label for an input, not submit, action. If it wasn't so wordy I would suggestaria-label="press enter to submit message"
. Any thoughts before I make this change?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.
I did a little more research, and it seems that the accessible name doesn't just need to contain the visible text; it needs to match or clearly include what you see on the screen.
For example, speech input users interact with web pages by speaking commands like
click send
orclick enter
. The tools they use rely on the accessible label to match what the user says.So if a button is labeled
Enter
, but its accessible name isPress enter to submit
, that mismatch can cause problems. The wordEnter
is present, but the label now sounds like an instruction instead of a button name. The speech tool might not recognize it when the user saysClick Enter
.In contrast, something like
Enter message
still feels like an action and would likely be recognized correctly.That said, I think that
Enter Message
makes sense as an accessible label because it's on a button. It's universally understood that after typing a message, you would pressEnter
to submit/send it.However, maybe this brings up another point that instead of
Enter
, we should useSend
orSubmit
. I'm not sure why we went withEnter
.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.
@greggb, any thoughts?
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.
Happy to update this to have
aria-label="Enter message"
. I wasn't sure if you wanted to further modify the action text. I think for the scope of this change keeping it as-is feels more appropriate and just adding the label. Agreed?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.
Agree!