palantir/blueprint

Blueprint v5 popover auto placement is different from v4

Open

#5760 opened on Nov 18, 2022

View on GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
Domain: APIPackage: popover2help wanted

Description

Environment

  • Package version(s): @blueprintjs/popover2 v1.10.0

Code Sandbox

Link to a minimal repro: https://sdlqfs.csb.app/

Problem

When configuring Popover2 with rootBoundary="viewport" or rootBoundary="document", the automatic popper.js placement has different behavior compared to Popover. This may be expected and a bugfix in some cases since the positioning engine has improved, but it may be unexpected in other cases.

There may be something we can improve here by setting / unsetting boundary and rootBoundary options on the various modifiers based on user-specified props. For example, I'm not sure that it's "correct" that we set boundary: "clippingParents" (applying the default) when the rootBoundary prop is defined: https://github.com/palantir/blueprint/blob/2460933e7084632f9f8b4f193fcda9fb9b3fd38f/packages/popover2/src/popover2.tsx#L493

Contributor guide