[Positioner] Not all sticky
and positionMethod
combos make sense
#1207
Labels
breaking change
component: menu
This is the name of the generic UI component, not the React module!
component: popover
The React component.
Finally got to test
sticky
andpositionMethod
options thoroughly:https://p8xtr7.csb.app/
https://codesandbox.io/p/sandbox/postion-method-sticky-combos-p8xtr7
Testing in Safari on a M1 Pro device:
* Note: in fixed containers,
sticky
value has no effectScreen.Recording.2024-12-20.at.16.41.12.mov
Chrome is better, as it skips fewer frames (but exactly in the same ways).
Firefox is similar/worse.
Effectively, there seems to be two combinations that make sense:
Am I missing the use cases for the rest?
positionMethod="absolute" sticky={false}
, but worse because it can skip framespositionMethod="fixed" sticky={true}
If not missing any use cases, it looks like this API can be reduced to a single boolean prop or a single string prop with two values.
One more thing to consider is that it might be viable to implement a different positioning strategy for a better sticky popup experience in a static container: use position absolute while the element is attached to the trigger and switch to position fixed when it attaches to the edge of the viewport. This way, the only opportunity to skip frames would be during the position change, and not during the rest of the scroll events.
The text was updated successfully, but these errors were encountered: