Skip to content

[Modal] / Missing animation when component is rendered with open set to true directly #1897

@loic-d

Description

@loic-d

Issue summary

Modal is not properly animated when rendered with open set to true directly.

open && <Modal open ... />

Jul-30-2019 14-08-21

<Modal open={open}

Jul-30-2019 14-11-20

For performance optimizations, we often defer the loading of the Modal and its content using createAsyncComponent from react-async. When following this recipe, you will loose the animation on Modal.

Expected behavior

Modal should always be animated when opened, wether the component is directly mounted with open set to true or open is toggled from false to true.

Actual behavior

The Modal is not properly animated (missing vertical translation).

Steps to reproduce the problem

See code sandbox link below.

Reduced test case

https://codesandbox.io/s/ancient-violet-z8te6

Specifications

  • Are you using the React components? (Y/N): Y
  • Polaris version number: "@shopify/polaris": "3.20.0",
  • Browser: Chrome
  • Device: Mac
  • Operating System: 10.14.5

Or run npx envinfo --system --binaries --browsers --npmPackages react,react-dom,@shopify/polaris to provide specifications on your environment including version numbers, browser, device, and operating system.

Paste the results here:

Metadata

Metadata

Assignees

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