Skip to content

fix(kit): put HoverCardContent attributes and handlers on the card - #151

Merged
riccardoperra merged 1 commit into
feat/upgrade-solid2-kobaltefrom
fix/hovercard-content-on-card
Nov 28, 2026
Merged

riccardoperra merged 1 commit into
feat/upgrade-solid2-kobaltefrom
fix/hovercard-content-on-card

Conversation

@riccardoperra

Copy link
Copy Markdown
Owner

Problem

After #150, HoverCardContent put any attribute or event handler other than class, style, ref and the dismiss handlers on a display: contents wrapper around the children. In CodeLoom this breaks two things:

  • Link preview: it passes onPointerEnter={hold} and onPointerLeave={hide}. Moving from the content onto the card's padding leaves the wrapper, so hide fires and the preview closes while the pointer is still on the card.
  • Composer menu: its onMouseDown preventDefault doesn't cover the padding, so a click there takes focus from the editor.

Fix

  • The active card's attributes and event handlers go on the shared card element itself.
  • They're applied when that card takes the shared card and removed when another card does; a previous attribute value is restored.
  • Handlers are attached with addEventListener and support Solid's [handler, data] form.
  • The wrapper is gone.

Kobalte reads a JSX spread only once, so they're applied in an effect.

Checks

  • Tests: the kit passes (677 browser, 34 SSR, 41 hydration), including a new test: attributes and handlers on the card, swapped when the card moves.
  • API and docs: api:check is updated and docs:lint passes.
  • Docs: the docs page and the unreleased changeset are updated.

🤖 Generated with Claude Code

Since the shared card, HoverCardContent put attributes and event
handlers on a display: contents wrapper around the children. A
pointerleave handler fired as soon as the pointer moved from the
content onto the card's padding, and a mousedown handler missed the
padding.

The active card's attributes and handlers now go on the card itself,
applied when it takes the card and removed when another card does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ec9472f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 3 packages
Name Type
@codeui/kit Minor
@codeui/styles Minor
@codeui/storybook-playground Patch

Click here to learn what changesets are, and how to add one.

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

@github-actions

Copy link
Copy Markdown
Contributor

CodeUI package preview

Built from ec9472f.

npm install https://pkg.pr.new/riccardoperra/codeui/@codeui/kit@ec9472f74d0c8246bf9ea7a08bc64a4943f01627

The kit installs matching previews of @codeui/styles and @codeui/inkstone.

@github-actions

Copy link
Copy Markdown
Contributor

Docs preview deployed to Cloudflare Pages.

Built from ec9472f.

@riccardoperra
riccardoperra merged commit d5a3631 into feat/upgrade-solid2-kobalte Nov 28, 2026
5 of 6 checks passed
@riccardoperra
riccardoperra deleted the fix/hovercard-content-on-card branch November 28, 2026 12:51

This branch was successfully deployed

1 active deployment
docs-preview — ec9472f7 Deployed Nov 28, 2026 by riccardoperra via Deploy to Cloudflare Pages #164
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