palantir/blueprint
View on GitHubDrawer animation bug when rendered inline and container overflows viewport
Open
#4,664 opened on Apr 22, 2021
P2Type: bughelp wanted
Description
Environment
- Package version(s): core 3.39.0+
- Operating System: macOS
- Browser name and version: Chrome 90
Code Sandbox
https://codesandbox.io/s/blueprint-sandbox-forked-cvz8o?file=/src/CoreExample.tsx
Steps to reproduce
- render a Drawer with
usePortal={false} canOutsideClickClose={false}(as in the above sandbox) - for a horizontal Drawer (Drawer A), resize window so that the Drawer container (where the drawer will render, since we're not using a portal) overflows horizontally (in the sandbox, this means make the preview window <800px wide)
- open Drawer A
Actual behavior
Jumpy animation as the component tries to bring the drawer into "focus" before its animation completes:

Expected behavior
Smooth animation, same as the one we see if canOutsideClickClose={true}
Possible solution
tabIndex may be a culprit https://github.com/palantir/blueprint/blob/a1121bc84b3783dd624e91002c07f68cfa80811e/packages/core/src/components/overlay/overlay.tsx#L398