Skip to content

fix: keep drag hover timers per element - #76

Merged
liuliu-dev merged 2 commits into
github:mainfrom
feritcemkahraman:fix/isolate-hover-timers
Oct 20, 2026
Merged

liuliu-dev merged 2 commits into
github:mainfrom
feritcemkahraman:fix/isolate-hover-timers

Conversation

@feritcemkahraman

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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
liuliu-dev merged commit b92a4e2 into github:main Oct 20, 2026
2 checks passed
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.

3 participants