Skip to content

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