You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Popover: rework props around shift, filp and resize behavior #43191
Currently, Popover exposes two props for tweaking its behavior when intersecting with the viewport's boundaries:
__unstableForcePosition
__unstableShift
However, it feels like these props don't offer the correct abstraction and actually limit the flexibility of the component.
Proposed next steps
We could look at removing __unstableForcePosition and replacing it with separate resize and flip props, in order to be more aligned with floating-ui's middleware options.
Bonus: we should also look at https://ariakit.org/examples/popover, and try to make a potential refactor of the component to ariakit as simple as possible
changed the title [-]We should understand what's the best API strategy for defining the Popover's behaviour when reaching the viewport boundaries — currently, the `Popover` component exposes the `__unstableForcePosition` and `__unstableShift` props. We should come up with a definitive API strategy (should we allow turning on/off `flip` and `shift` separately?) and remove those `__unstable` props[/-][+]Popover: rework props around shift, filp and resize behavior[/+]on Aug 12, 2022
Bonus: we should also look at https://ariakit.org/examples/popover, and try to make a potential refactor of the component to ariakit as simple as possible
Nearly forgot, I looked at how ariakit's popover works.
It seems like that uses a fitViewport prop, which I guess is roughly the same as resize (though I don't know if 'viewport' is correct, but maybe that's just a nitpick):
Activity
[-]We should understand what's the best API strategy for defining the Popover's behaviour when reaching the viewport boundaries — currently, the `Popover` component exposes the `__unstableForcePosition` and `__unstableShift` props. We should come up with a definitive API strategy (should we allow turning on/off `flip` and `shift` separately?) and remove those `__unstable` props[/-][+]Popover: rework props around shift, filp and resize behavior[/+]talldan commentedon Aug 17, 2022
It turns out I didn't need this to fix the issue with legacy widgets (#43297).
But I can still push a PR that refactors this.
talldan commentedon Aug 17, 2022
Nearly forgot, I looked at how ariakit's popover works.
It seems like that uses a
fitViewportprop, which I guess is roughly the same asresize(though I don't know if 'viewport' is correct, but maybe that's just a nitpick):And there's a
flipprop:So that may be another reason to still change the props.
ciampo commentedon Aug 17, 2022
Thank you for the exploration!
That would be great!
ciampo commentedon Aug 30, 2022
Reopening as the
shiftprop is still marked as__unstable— we should:shiftprop with the same default value of__unstableShift__unstableShift@talldan , would you be able to work on this? It should be a quick one.
ciampo commentedon Sep 5, 2022
#43845