palantir/blueprint

Blueprint v5 popover auto placement is different from v4

Open

#5 760 ouverte le 18 nov. 2022

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)TypeScript (2 167 forks)batch import
Domain: APIPackage: popover2help wanted

Métriques du dépôt

Stars
 (20 263 stars)
Métriques de merge PR
 (Merge moyen 43j 10h) (27 PRs mergées en 30 j)

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

Guide contributeur