Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delegate does not support shadow dom for Firefox #765

Closed
michaelw85 opened this issue Nov 12, 2019 · 0 comments · Fixed by #766
Closed

Delegate does not support shadow dom for Firefox #765

michaelw85 opened this issue Nov 12, 2019 · 0 comments · Fixed by #766

Comments

@michaelw85
Copy link
Contributor

I'm submitting a bug report

Related to: #755

  • Library Version:
    2.5.0

Please tell us about your environment:

  • Operating System:
    Windows [10]

  • Node Version:
    10.15.1

  • NPM Version:
    6.10.2
  • Browser:
    Firefox 70.0.1 (64-bits)

  • Language:
    all

Current behavior:
Clicking nested elements in shadow dom does not trigger click delegate.

In my case this fails for a search input with a search button.
image

The search button has a click.trigger which should dispatch a custom "on-search" event. This fails due to:

// event-manager.js:7
function findOriginalEventTarget(event) {
  return (event.path && event.path[0]) || (event.deepPath && event.deepPath[0]) || event.target;
}

Result in firefox:
spec-input-search (custom search component containing the search button)

Chrome (which works properly):
button

Reason for failure:
Firefox does not have event.path or deepPath so falls back to target which does not take shadow dom into account.

Proposed solution:
Use composedPath before using fallback to event.target

Expected/desired behavior:
When using shadow dom, nested should handle click delegate properly

michaelw85 added a commit to michaelw85/binding that referenced this issue Nov 12, 2019
Return correct original event target for Firefox

Closes aurelia#765
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 a pull request may close this issue.

1 participant