Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add listener in capture phase and locate nearest source if needed
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
- Loading branch information