Uh oh!
There was an error while loading. Please reload this page.
[6.x] Avoid layout thrashing from Reka's aria-label fallback - #15264
Merged
Conversation
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Reka UI's
SwitchRootandCheckboxRootcompute a fallbackaria-labelviadocument.querySelector('[for="<id>"]').innerText, on mount and again whenever theiridchanges.innerTextforces a full synchronous layout, so on large publish forms this runs once per toggle.On a 105-set Bard entry that was ~10.5s of the page load, and ~21s when pressing Enter near the top of the Bard field — inserting a node renumbers every following set, which changes every nested field's id.
Reka skips that computed when a truthy
aria-labelattribute is supplied, so we now pass the real accessible name ourselves:__(config.display), the same text as its<label for>.Checkbox/Item.vuepasseslabel || valuewhen no custom slot is rendered.Measured on the same entry: Enter-at-start 21s → 1.1s, page-load
innerTextcost 10.5s → 0.Radio is intentionally not covered here: Reka's
Radiooverrides a caller-suppliedaria-label, so it needs an upstream fix.