Conversation
`disabled` keeps the Radix tree mounted and forces the tooltip closed instead of unwrapping the children, so toggling it while the user types in a field (volumes NameTakenTooltip, vpc LockedFieldTooltip) does not remount the field and drop its focus. `asOverlay` renders an invisible, positionable trigger over the children instead of wrapping them, for controls that cannot be wrapped or are disabled: native pointer events do not fire on disabled buttons and inputs, so a tooltip explaining why a field is locked needs its own hit area. `overlayClassName` positions it (whole control by default), and `overlayLabel` names it for assistive technology when the content is not plain text.
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.
Summary
disabled: keeps the Radix tree mounted and forces the tooltip closed instead of unwrapping the children, so toggling it while the user types in a field does not remount the field. Volumes (NameTakenTooltip) and vpc (LockedFieldTooltip) implemented anenabledflag locally, the vpc one by returning the children untouched (which remounts them).asOverlay: renders an invisible, positionable trigger over the children instead of wrapping them, for controls that cannot be wrapped or are disabled (native pointer events do not fire on disabled buttons/inputs).overlayClassNamepositions the hit area (whole control by default; e.g.right-0 top-7 h-10 w-8to cover only the right edge of an input so typing still works).overlayLabelnames it for assistive technology whencontentis not a string.wrapperClassNamestyles the relative wrapper.Default behaviour is unchanged.
Test plan
npx vitest run lib/components/Tooltip, lint, types, prettierTooltip→Disabled,OverlayOnField