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

Get it working well with Chakra UI components #8

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

Conversation

hariombalhara
Copy link

@hariombalhara hariombalhara commented Sep 22, 2021

  1. Capture Phase listener allows the plugin to work for the cases where stopPropagation is done in the bubble phase.
  2. Looking for the nearest parent element with dataset source handles the case when the element directly doesn't have dataset source. This happens if the element is not created through JSX e.g. Chakra UI ModalCloseButton. Basically, any component coming through an npm dependency should have this problem. See https://codesandbox.io/s/suspicious-breeze-smdrq?file=/src/index.js

@hariombalhara hariombalhara changed the title Add listener in capture phase and locate nearest source if needed Get it working well with Chakra UI components Sep 22, 2021
1. Capture Phase listener allows the plugin to work for the cases where stopPropagation is done in bubble phase.
2. Looking for nearest parent element with dataset source handles the case when the element directly doesn't have dataset source. This hhappens if the element is not created through JSX e.g. Chakra UI ModalCloseButton. Basically any component coming through an npm dependency should have this problem. See https://codesandbox.io/s/suspicious-breeze-smdrq?file=/src/index.js
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.

1 participant