Skip to content

[Modal] Matching exit animation not present when set to true directly #2078

@mitchmaps

Description

@mitchmaps

Issue Summary

Related to #1897 which was closed by this PR, when the modal closes, the correct slide down animation is missing when the component is set to true directly using the syntax open && <Modal open={open} />.

Expected behaviour

See the Modal component on the Polaris site.
The modal should perform the correct slide down animation when it's dismissed.

Actual behaviour

Click to view collapsed gif

No exit animation

See this example: https://codesandbox.io/s/ancient-violet-z8te6

The slide down animation isn't happening when the modal is closed so it just disappears instead 😬.

Steps to reproduce the problem

  1. Set up a playground which uses the Modal and use the open && <Modal open={open} /> syntax
  2. Inspect the lack of animation

Reduced test case

This CodeSandbox template is a great starting point.

Specifications

  • Are you using the React components? (Y):
  • Polaris version number:
  • Browser: Chrome
  • Device: Desktop
  • Operating System: MacOS 10.14.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken and not working as intended in the system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions