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

Using event.composedPath to replace event.target #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fang-lin
Copy link

@fang-lin fang-lin commented Mar 26, 2021

When we use this date range picker in a custom element. The date picker should be opened when the user clicks the date range input. But actually, it doesn't work.

We spiked the root cause, in a normal DOM, the clickAway handler was added in the document.body, the event.target is the date range span. But if in a shadow root, the event.target is the host element of the shadow root.

change to use composedPath() function. it could work in both cases normal element and shadow root.

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.

None yet

1 participant