fix(Tooltip): close trigger on pointerdown for any pointer button - #2101
Merged
Conversation
🦋 Changeset detectedLatest commit: 5dde078 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Tooltip.Trigger only closed on `click`, so right and middle click left an open tooltip sitting under the native context menu. Close on `pointerdown` instead (as Radix does), which also cancels a pending delayed open so the tooltip can no longer appear after the context menu has opened. Gated by `disableCloseOnTriggerClick` so the prop keeps meaning "the trigger doesn't dismiss", matching the existing `onInteractOutside` exemption. Closes huntabyte#2099
MathiasWP
force-pushed
the
fix-bits-ui-issue-2099
branch
from
August 19, 2026 14:05
4f5c2af to
5dde078
Compare
Merged
dadezzz
pushed a commit
to dadezzz/events-cash-register
that referenced
this pull request
Aug 24, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [bits-ui](https://github.com/huntabyte/bits-ui) | [`2.18.2` → `2.19.0`](https://renovatebot.com/diffs/npm/bits-ui/2.18.2/2.19.0) |  |  | --- ### Release Notes <details> <summary>huntabyte/bits-ui (bits-ui)</summary> ### [`v2.19.0`](https://github.com/huntabyte/bits-ui/releases/tag/bits-ui%402.19.0) [Compare Source](https://github.com/huntabyte/bits-ui/compare/bits-ui@2.18.2...bits-ui@2.19.0) ##### Minor Changes - feat(Checkbox): pass `form` to the hidden input ([#​2089](huntabyte/bits-ui#2089)) ##### Patch Changes - fix(DateField): keep focus on the year while correcting its first digit ([#​2100](huntabyte/bits-ui#2100)) - fix(Tooltip): close `Tooltip.Trigger` on `pointerdown` for any pointer button so right/middle click dismiss the tooltip and cancel a pending delayed open ([#​2101](huntabyte/bits-ui#2101)) - fix(RadioGroup): don't select item on pointer-driven focus- [#​2098](huntabyte/bits-ui#2098) ([#​2098](huntabyte/bits-ui#2098)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDQuMzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
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.
Closes #2099
Tooltip.Triggeronly closed from itsclickhandler, so right and middle click left the tooltip open under the native context menu. The dismissible layer doesn't catch it either — it rejects outside interactions withe.button > 0.Close on
pointerdownregardless of button, as Radix does. The handler already had the matchingisPointerDown+pointerupbookkeeping; only the close was missing.Two notes:
disableCloseOnTriggerClick, matchingonInteractOutside, which already exempts the trigger when that prop is set.handleClose()writesopen.current = falseunconditionally, which would fire a spuriousonOpenChange(false)on every pointerdown;cancelPendingOpen()just stops the timer.Also fixed the
disableCloseOnTriggerClickAPI-reference description, which described the escape key.Five tests added; three fail without the fix. Middle-click and pending-open use a synthetic
pointerdownbecause WebKit intermittently delivers no events at all forclick({ button: "middle" }).