Skip to content

Form + form inside a modal dialog #8896

Answered by leapful
Falci asked this question in Q&A
Discussion options

You must be logged in to vote

@Falci @Moshyfawn @chetvishal

UI library "react-bootstrap in the example uses React Portal to show modal form by appending the modal to the default container "document.body".

According to React Portal documentation (https://reactjs.org/docs/portals.html#event-bubbling-through-portals):

Even though a portal can be anywhere in the DOM tree, it behaves like a normal React child in every other way. Features like context work exactly the same regardless of whether the child is a portal, as the portal still exists in the React tree regardless of position in the DOM tree.

This includes event bubbling. An event fired from inside a portal will propagate to ancestors in the containing React tree, …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@russ0133
Comment options

Answer selected by Falci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants