Skip to content

Fix component bugs found during the TypeScript migration#42732

Open
mdo wants to merge 2 commits into
issue-42620from
post-ts-followups
Open

Fix component bugs found during the TypeScript migration#42732
mdo wants to merge 2 commits into
issue-42620from
post-ts-followups

Conversation

@mdo

@mdo mdo commented Jul 22, 2026

Copy link
Copy Markdown
Member

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.

  • tooltip: compare Floating UI arrow coordinates against undefined (the value the arrow middleware actually reports) instead of null, so an absent cross-axis coordinate no longer writes left: "undefinedpx". Also adapt an offset callback's [skidding, distance] array return into Floating UI's { mainAxis, crossAxis } shape, matching the array/string config forms.
  • dialog: remove the unnamespaced native cancel listener on dispose()BaseComponent.dispose() only clears EVENT_KEY-namespaced listeners, so it previously leaked past teardown. (Left unnamespaced because cancel is a native event, not one of our namespaced custom events.)
  • 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 on remove() so duplicate chips stay in sync with the DOM when allowDuplicates is enabled (previously filter stripped every matching value from state while one element remained).
  • strength: drop the unused score argument passed to _updateUI (the meter fill derives from strength).
  • toggler: document that value is required — the null default is a must-override placeholder and DefaultType intentionally 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. Built dist/js/dist rebuilt in a separate commit.

A further latent bug found along the way — the change.bs.chips event name colliding with the native change event so listeners never receive it — is left for a separate PR as it needs an event rename.

@mdo
mdo requested a review from a team as a code owner July 22, 2026 00:00
mdo added 2 commits July 24, 2026 14:54
- 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.
@mdo
mdo force-pushed the post-ts-followups branch from ecbae6a to 7ff878f Compare July 24, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant