Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

unexpected mouseover/mouseout behavior w/ capture #67

Open
mxdubois opened this issue Apr 1, 2015 · 0 comments
Open

unexpected mouseover/mouseout behavior w/ capture #67

mxdubois opened this issue Apr 1, 2015 · 0 comments
Labels
bug Something isn't working library Relates to an Origami library

Comments

@mxdubois
Copy link

mxdubois commented Apr 1, 2015

With a structure like this:

  <div class="my-delegator">
    <div class="my-button">
      <span class="my-button-text">I'm a button</span>
    </div>
  </div>

If I attach a listener on "my-delegator", like so:

  foo = document.querySelectorAll(".my-delegator")
  delegator = new ftdom.Delegator(foo)
  delegator.on("mouseover", ".my-button", someFunc, true)
  delegator.on("mouseout", ".my-button", someFunc, true)

I get the expected mouseover/mousout events when the cursor crosses the border of "my-button". But then I also get a "mouseout" event from "my-button" when the cursor goes from inside the button padding to inside the button text and, even weirder, I get a "mouseover" event from "my-button-text".

I'd expect to only get "mousover" and "mouseout" events when the cursor crosses the border of "my-button". At the very least, the selector passed to on should filter out the "mouseover" events coming from the inner node ("my-button-text"), but I'd also prefer not to get the "mouseout" event when the cursor moves deeper into the subtree.

@mxdubois mxdubois changed the title unexpected mouseover/mouseout behavior unexpected mouseover/mouseout behavior w/ capture Apr 1, 2015
@JakeChampion JakeChampion added bug Something isn't working library Relates to an Origami library labels Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working library Relates to an Origami library
Projects
None yet
Development

No branches or pull requests

2 participants