Clean up sr-only usage by removing or converting to aria-label
Categories
(Firefox :: New Tab Page, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | verified |
People
(Reporter: Mardak, Assigned: emcminn)
References
(Blocks 1 open bug)
Details
(Keywords: github-merged)
Attachments
(2 files)
Various places use <span class=sr-only>
to have "invisible" text that are actually redundant or better exposed with aria-label
attribute. We can clean this up at the same time we're converting strings to fluent.
Reporter | ||
Comment 1•5 years ago
|
||
Jotting down some notes:
For the "Seach" button, looks like the title attribute is enough to make it show up in the accessibility devtools view, so we can just remove the sr-only button child.
Similarly for the "Search the Web" exposed as 1) label with text child and 2) on the input box entry itself. It looks like (2) is sufficient so (1) can be removed.
There's various other uses mostly for context menu it seems.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Do we want to remove the sr-only spans that contain localized <FormattedMessage/> components? I'm tempted to leave them, only because I don't think aria-label will accept a component and we probably don't want to lose that behaviour.
EDIT: I think I've answered my own question - the titles contain the localized messages, so it should be okay to remove the components. That's what I'll do for now!
Reporter | ||
Comment 3•5 years ago
|
||
Right, in some places we might need something other than title
attribute in fluent. The purpose of fluent migration is to get rid of both <FormattedMessage>
declarations and the js API .formatMessage
calls, so it's not an issue that the jsx attribute doesn't accept a component because it's not how we would do it with fluent.
Comment 4•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
Comment 6•5 years ago
|
||
I have verified that this issue is no longer reproducible with the latest Firefox Nightly (69.0a1 Build ID - 20190630214222) installed, on Windows 10 x64, Arch Linux and Mac 10.14.5. Now if we set the "browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar" pref to false, we will observe that the "aria-label="Search the Web"" string is added.
Description
•