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

[Bug]: OverlayDrawer applies motion to mountNode when rendering as overlay inside container #33583

Open
2 tasks done
sgbdev opened this issue Jan 8, 2025 · 0 comments
Open
2 tasks done

Comments

@sgbdev
Copy link
Contributor

sgbdev commented Jan 8, 2025

Component

Drawer

Package version

9.56.8

React version

18.3.1

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (28) x64 13th Gen Intel(R) Core(TM) i7-13850HX
    Memory: 31.68 GB / 63.69 GB
  Browsers:
    Edge: Chromium (131.0.2903.99)

Current Behavior

Issue

Motion is unexpectedly applied to mountNode element when rendering an OverlayDrawer inside a container, and using position="end". I observed this in my own app, and thought perhaps it was something with my own styles having an effect. To eliminate that possibility, I opened the code example Overlay Inside Container in StackBlitz, added position="end" to the OverlayDrawer component and was able to reproduce the issue.

To explain what is happening in the gif below, when the "open drawer" button is clicked, the drawer appears on the right side of the container, and then the overlay begins to slide in from the left. But as the overlay slides in, so does the mountNode element. So it's almost like the motion being applied to the overlay element is also being applied to the mountNode element.

I used the Animations tab in Chrome Dev Tools to inspect and slow the animation speed to 10% so its easier to observe. The issue remains when the animation speed is 100%.
Image

Workaround

Setting the surfaceMotion slot to null, on OverlayDrawer, appears to eliminate the issue.

Expected Behavior

Motion should only affect the overlay and not the mountNode element.

Reproduction

https://stackblitz.com/edit/shd9svh6

Steps to reproduce

  1. Click "Open Drawer" button.
  2. Observe animations on mountNode element.

Are you reporting an Accessibility issue?

None

Suggested severity

Medium - Has workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant