Skip to content

Either document or rethink Portal usage #699

Open
@reverie

Description

@reverie

Summary:

The usage of React's Portal feature causes surprising behavior. A modal is visually and conceptually a separate interface element from the element that opens the portal.

Example 1: If you click on a button to open a modal, should clicking on that modal bubble up to the button? No.

Example 2: If you open a modal from a form, for example to autocomplete an input to that form, should submitting the modal's form submit the outer form? No.

What makes this behavior worse than merely surprising is that it is not documented anywhere. Given that modals are separate from the elements that create them, I don't think creation of a Portal should be the default behavior of this library. If it will remain the default, it should be documented, and ideally an option to turn it off should be provided.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions