Controller is causing event bubbling, creating issue when working with ClickAwayListener #7457
Unanswered
Kerim-Willem
asked this question in
General
Replies: 2 comments
-
can you share a simple codesandbox? |
Beta Was this translation helpful? Give feedback.
0 replies
-
offtopic: when i looking for a issue related to the lack of event bubbling... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
We're currently working with react-hook-form within a modal. I'm trying to add a function that fires an event listener, that closes the modal, only when I'm clicking outside of it.
Whenever I click on one of the components from the react-hook-form library, a click-event is being fired on the body, instead of the component. This is causing a click outside of the Modal, while the click is happening inside the Modal.
I found out that this is happening because of event bubbling. I experience the same issue with other components which are wrapped in a react-hook-form.
I've looked everywhere and really can't find out the solution. Can you help me by explaining how to prevent event bubbling from the react-hook-form components?
Help is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions