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

unexpected mouseover/mouseout behavior w/ capture #67

@mxdubois

Description

@mxdubois

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglibraryRelates to an Origami library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions