Skip to content

feat(tooltip): add overflow-only trigger support#3864

Open
mayank1513 wants to merge 3 commits intoradix-ui:mainfrom
mayank1513:feat/overflow-only-tooltip
Open

feat(tooltip): add overflow-only trigger support#3864
mayank1513 wants to merge 3 commits intoradix-ui:mainfrom
mayank1513:feat/overflow-only-tooltip

Conversation

@mayank1513
Copy link
Copy Markdown

Description

Add onlyShowOnOverflow and overflowTolerance to Tooltip.Trigger to enhance UX for overflow-only tooltip use cases. onlyShowOnOverflow defaults to false, preserving existing behavior and accessibility unless explicitly enabled. Even when explicitly enabled it preserves accessibility - only gates hover.

…s set

- Return true from isElementOverflowing when no element is provided,
  preserving default open behavior on focus
- Add test: opens on focus even when onlyShowOnOverflow is true and not overflowing
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: 0df385b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@radix-ui/react-tooltip Minor
radix-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mayank1513 mayank1513 changed the title feat(tooltip): add overflow-only trigger support feat(tooltip): add overflow-only trigger support Apr 22, 2026
@mayank1513
Copy link
Copy Markdown
Author

I would prefer overflorOnly instead of onlyShowOnOverflow. However, I saw some longer descriptive names in the code. So preferred clarity.

What do you prefer?

@mayank1513
Copy link
Copy Markdown
Author

#3865

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