Fix component bugs found during the TypeScript migration#42732
Open
mdo wants to merge 2 commits into
Open
Conversation
- tooltip: compare Floating UI arrow coords against undefined (not null),
the value the arrow middleware actually reports, so an absent cross-axis
coordinate no longer writes "undefinedpx"; adapt array results from an
offset callback to Floating UI's { mainAxis, crossAxis } shape
- dialog: remove the unnamespaced native cancel listener on dispose so it
no longer leaks past teardown
- nav-overflow: namespace the fallback window resize listener and remove it
on dispose; drop the write-only _isInitialized flag
- chips: remove only a single value entry so duplicate chips stay in sync
with the DOM under allowDuplicates
- strength: drop the unused score argument passed to _updateUI
- toggler: document that value is required (the null default is a
must-override placeholder)
Adds unit coverage for each fix, including a new chips spec.
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 free
to 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.
Stacked on #42724 (targets its branch, not v6-dev). Fixes latent bugs surfaced while migrating the JS to TypeScript — each was documented in that PR and left unchanged there to keep the migration byte-identical.
undefined(the value the arrow middleware actually reports) instead ofnull, so an absent cross-axis coordinate no longer writesleft: "undefinedpx". Also adapt an offset callback's[skidding, distance]array return into Floating UI's{ mainAxis, crossAxis }shape, matching the array/string config forms.cancellistener ondispose()—BaseComponent.dispose()only clearsEVENT_KEY-namespaced listeners, so it previously leaked past teardown. (Left unnamespaced becausecancelis a native event, not one of our namespaced custom events.)windowresizelistener and remove it ondispose(); drop the write-only_isInitializedflag.remove()so duplicate chips stay in sync with the DOM whenallowDuplicatesis enabled (previouslyfilterstripped every matching value from state while one element remained).scoreargument passed to_updateUI(the meter fill derives fromstrength).valueis required — thenulldefault is a must-override placeholder andDefaultTypeintentionally rejects it.Adds unit coverage for each fix, including a new
chips.spec.js(chips had no prior tests); keeps the global branch-coverage gate satisfied. Builtdist/js/distrebuilt in a separate commit.A further latent bug found along the way — the
change.bs.chipsevent name colliding with the nativechangeevent so listeners never receive it — is left for a separate PR as it needs an event rename.