Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure unmount on Dialog works in combination with the transition prop on DialogBackdrop and DialogPanel components #3352

Merged
merged 2 commits into from
Jul 1, 2024

Commits on Jul 1, 2024

  1. inherit unmount from Dialog in DialogBackdrop and DialogPanel

    … components
    
    Only the `Dialog` accepts an `unmount` prop because it's the `Dialog`
    that is conditionally rendered and the `DialogBackdrop` and
    `DialogPanel` will conditionally show together with the `Dialog`.
    
    However, now that the `Dialog` is wrapped in a `Transition` (which can
    be unmounted) and the `DialogBackdrop` and `DialogPanel` will also be
    wrapped in a `TransitionChild` (when the `transition` prop is passed)
    then we do have to deal with the `unmount` state on the `TransitionChild`.
    
    This is important because if you make the `Dialog` `unmount={false}`, then the
    `DialogPanel` will still unmount because the `TransitionChild` is unmounting its
    children. This now means that you will lose data (such as form state of inputs).
    
    This commit solves that by inheriting the `unmount` state of the
    `Dialog` in the `TransitionChild` wrappers such that they behave the way
    you expect them to behave.
    RobinMalfait committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    7d7e3e4 View commit details
    Browse the repository at this point in the history
  2. update changelog

    RobinMalfait committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    9149268 View commit details
    Browse the repository at this point in the history