Repository navigation
fix(tooltip): don't open an empty bubble when content is missing (Solid 2) - #153
Merged
riccardoperra merged 1 commit intoNov 28, 2026
Conversation
Port of #152 (05d9889) to the Solid 2 / Kobalte 2 branch. When `content` is `undefined`, `null`, `false` or `""`, Tooltip now passes `disabled` to the Kobalte root and skips the portal. Hover and focus leave it closed, and Kobalte only sets `aria-describedby` while open, so the trigger never points at a missing bubble. The trigger, its children and `slotClasses.trigger` render unchanged. The conflict in Tooltip.tsx was resolved for Solid 2 (`omit` instead of `splitProps`, reading `props.*`). The verify-codeui journey waits 1 s after hover and focus, since this branch's default `openDelay` is 700 ms. Adds an "Empty content" story, a verify-codeui journey and unit tests. (cherry picked from commit 05d9889) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: f225914 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
CodeUI package previewBuilt from npm install https://pkg.pr.new/riccardoperra/codeui/@codeui/kit@f225914b615737675a26cc8cc83ac9513c50f63eThe kit installs matching previews of |
riccardoperra
merged commit Nov 28, 2026
57722e1
into
feat/upgrade-solid2-kobalte
5 of 6 checks passed
Contributor
|
Docs preview deployed to Cloudflare Pages.
Built from f225914. |
This branch was successfully deployed
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.
Ports #152 (merged to
mainas 05d9889) tofeat/upgrade-solid2-kobalte.What
When
Tooltip'scontentisundefined,null,falseor"", the tooltip stays closed on hover and on focus, and no empty bubble appears. The trigger, its children andslotClasses.triggerrender as before. The trigger never gets anaria-describedbythat points at nothing.The fix is the same as on
main.Tooltippassesdisabledto the root when the content is empty, and it skips the portal and content. Kobalte 2.0.0-alpha.5'sTooltipRootchecksisDisabled()in both its pointer path and its focus path, sodisabledstops both.Porting notes
Tooltip.tsx. I re-applied the behaviour in this branch's Solid 2 style (omitandprops.*instead ofsplitProps/local) rather than copying the file. feat(kit): calmer tooltip defaults and TooltipProvider #149'sRootdefaults andTooltipProviderinparts/tooltip.tsxare unchanged.tooltip-empty.mjswaited 600 ms after hover or focus. Since feat(kit): calmer tooltip defaults and TooltipProvider #149, the defaultopenDelayon this branch is 700 ms, so a 600 ms wait would pass even if a bubble were about to open. It now waits 1000 ms.Verification
vitest --project browser: 680/680 passing. This includes the 3 new empty-content cases andtooltip-provider.test.tsx, which covers the provider and the shared-delay behaviour from feat(kit): calmer tooltip defaults and TooltipProvider #149. One cold-start run had 4 unrelated failures (keyboard/listbox); the next two runs passed in full.test:ssr34/34,test:hydration2 + 41 passing.typecheckpasses.pnpm api:checkreports "Public API matches the committed report".designsystem-tooltip--empty-content+tooltip-empty.mjs: hovering and Tab-focusing Undefined, Null and Empty string shows no bubble and adds noaria-describedby. "With content" still opens on focus and on hover, and describes the button.designsystem-tooltip--tooltip-story+tooltip-keyboard.mjsandtooltip-motion.mjs: no regression in focus/Escape, motion or description placement.designsystem-tooltip--tooltip-disabled: renders.landmark-one-mainandpage-has-heading-one.TooltipProvider; the unit tests cover it.🤖 Generated with Claude Code