fix(admin): remove a grid chip via its × instead of leaving edit mode#637
Merged
Conversation
Ark's combobox InteractOutsideEvent is a CustomEvent whose actually-clicked element is in event.detail.target, not event.target (the dispatch node). The ChipSelect read event.target, so in a real browser a chip's × — which sits in the cell but outside the combobox control, the only in-cell click that reaches interact-outside — read as "outside" and committed the cell, leaving edit mode instead of removing the chip. Read event.detail.target, falling back to event.target where detail is absent. The failure only manifests in a real browser (jsdom doesn't fire interact-outside; the Playwright runner doesn't reproduce it either), so the added e2e test guards the × behaviour generally rather than as a strict regression guard for this event bug. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
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.



Summary
Fixes the admin grid's chip cell editor (
ChipSelect): clicking a chip's × left edit mode instead of removing the chip (reported on/ui/admin/customers).Cause
Ark's combobox
InteractOutsideEventis aCustomEventwhose actually-clicked element is inevent.detail.target, notevent.target(the dispatch node — e.g. the document). The handler readevent.target, so a chip's × — which sits in the cell but outside the combobox control, the only in-cell click that reachesonInteractOutside— read as "outside the cell" and committed it, leaving edit mode. The×button's ownonClick(remove + refocus) never got to matter because the cell had already closed.Fix
Read
event.detail.target(falling back toevent.targetwheredetailis absent).Verification
bun run typecheck/lintclean;chipSelectunit tests (13) pass.admin-inline-edit.spec.ts: after clicking a chip's ×, the chip is gone and the cell is still being edited.detail.target= the click target).