palantir/blueprint

Blueprint v5 popover auto placement is different from v4

Open

#5,760 建立於 2022年11月18日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
Domain: APIPackage: popover2help wanted

描述

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

貢獻者指南