moz-label accesskeys are not updated when accesskey and text change together
Categories
(Firefox :: Settings UI, defect, P3)
Tracking
()
People
(Reporter: mstriemer, Unassigned)
References
Details
(Whiteboard: [recomp])
Before bug 1976006 the text labels weren't being cleaned up properly, the changes there fixed the text labels, but if the accesskey also changes then the accesskey is not updated.
I believe this is happening:
- Fluent updates the moz-checkbox's
labelandaccesskeyattributes - moz-checkbox sets the
shownaccesskeyattribute on moz-label - moz-label's
attributeChangedCallbackfires synchronously - moz-label pauses its mutation observer since it is about to cause a mutation
- The displayed accesskey is updated, however the textContent has not yet changed
- moz-label queues a microtask to resume mutation listeners
- moz-checkbox sets the textContent of the moz-label
- moz-label starts observing mutations again
This is the sort of thing that LitElement/ReactiveElement will paper over for us, but since we're inheriting from HTMLLabelElement here, we don't get that help.
We'll likely want to do something similar where we queue updates when any of the conditions change. It looks like Lit accomplishes this by awaiting the previous update. Rather than pausing the MutationObserver we may want to cache the last string we formatted the accesskey on, and ignore the event if the textContent is unchanged
Updated•1 year ago
|
Updated•11 months ago
|
| Reporter | ||
Comment 1•5 months ago
|
||
We are working around this issue in MozBaseInputElement by setting the label using .textContent Searchfox
Anyone that uses moz-label directly would run into these issues though.
moz-button uses moz-label and runs into the similar issue when l10nId that provides both label and accesskey updates dynamically (see bug 2022326)
Description
•