Skip to content

fix: close v1 filter chip when clicking icon#3759

Draft
bdfranck wants to merge 1 commit intodevfrom
benji/fix-v1-filter-chip-click
Draft

fix: close v1 filter chip when clicking icon#3759
bdfranck wants to merge 1 commit intodevfrom
benji/fix-v1-filter-chip-click

Conversation

@bdfranck
Copy link
Copy Markdown
Collaborator

@bdfranck bdfranck commented Apr 2, 2026

Before (the change)

After (the change)

The reason

The problem is a race between Chrome's focus event and the goa-icon shadow DOM re-render:

Step What happens in Chrome
1 mousedown on goa-icon → browser focuses the parent div
2 focus fires → _focused = true → Svelte re-renders
3 goa-icon receives new theme="filled" prop → shadow DOM re-renders under the cursor
4 mouseup / click fire — but Chrome sees the hit-target changed, so click is dropped

Firefox is more permissive and fires click even when the shadow DOM target shifts mid-gesture, which is why it works there on the first click.

Adding pointer-events: none to .delete-icon makes the goa-icon element transparent to all mouse events, so every click falls straight through to the outer div.chip that holds the on:click={onDelete} handler. The icon in the v1 chip is purely decorative anyway — the whole chip is meant to be the button.

@bdfranck bdfranck linked an issue Apr 3, 2026 that may be closed by this pull request
@bdfranck bdfranck requested a review from Copilot April 3, 2026 03:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an issue in Chrome where clicking the close icon on the v1 filter chip can fail due to focus-triggered re-rendering of the goa-icon shadow DOM mid-gesture.

Changes:

  • Disable pointer event handling on the v1 close icon so pointer events consistently target the chip container click handler.

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.

FilterChip focusing not closing on icon click

2 participants