hotwired / hotwired/stimulus

Firefox mouseleave@document action does not work

Open
#699 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
13.1k
Forks
441
PR merge metrics
No merged PRs in 30d

Description

My problem is that mouseleave@document at firefox does not work, there are some workaround which could make it work, but i cannot implement it inside stimulus.

This shows clearly the issue
https://stackoverflow.com/questions/66245558/mouseenter-and-mouseleave-event-listeners-on-document-not-working-in-firefox

document.addEventListener("mouseenter", () => {
console.log("mouseenter");
});

does not work on firefox
document.querySelector("body").addEventListener("mouseenter", () => {
console.log("mouseenter");
});
or
document.documentElement.addEventListener('mouseleave', () => {})
does work.

any hint how i could make it work?

thanks for suggestions

my action data looks like following:
data-action="mouseleave@document->newsletter-popup#show"
which works perfeclty under chrome.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the data-action="mouseleave@document->newsletter-popup#show" example in Firefox and compare it with the working Chrome behavior. Trace how Stimulus attaches document-level actions, then determine whether the issue can be fixed in the event handling or needs a documented limitation and workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.