Repository navigation
fix: keep drag hover timers per element - #76
Merged
liuliu-dev merged 2 commits intoOct 20, 2026
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The localized fix resolves cross-element timer cancellation, and the regression test covers the reported failure.
No open issues 🎉
What changed in this PR
Fixes stuck hover highlights when multiple <file-attachment> elements receive drag events.
Changes:
- Stores cleanup timers per element using a
WeakMap. - Adds regression coverage for independent hover cleanup.
| File | Description |
|---|---|
| test/test.js | Checks that both highlights appear and clear independently. |
| src/file-attachment-element.ts | Prevents elements from cancelling each other’s timers. |
Review effort: Max
liuliu-dev
approved these changes
Oct 20, 2026
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.
When a page has multiple
<file-attachment>elements, drag activity on one cancels the other's hover cleanup timer. Its[hover]highlight can remain after the drag stops.Keep the timer per element so each drop area's highlight expires independently. The regression checks both highlights are present during dragging and cleared afterward.
Validation: the regression failed before the fix; all 18 Chromium tests pass afterward. Full ESLint, TypeScript/declarations and ESM/UMD Rollup builds pass on Node 24. The Windows cleanup wrapper was skipped by running the same tools directly; Firefox and WebKit were not run.