Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Popper] Add collision strategy option #2928

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mazei513
Copy link

Description

Adds collisionStrategy prop to Popper.Content to control how the placement is done when it collides with a boundary. The two options are 'flip' and 'shift'. 'flip' is how it is currently done, where it uses the flip middleware from Floating UI. The new option for 'shift' will instead rely on the shift middleware, which is already used to avoid collisions for the alignment, but using this option also uses it for the side collision.

Fixes #2842

Gives a way to control how popper placement collision is handled, either
using flip or shift middlewares from Floating UI. By default, it is set
to flip for backwards compatibility.

Fixes issue radix-ui#2842

* [Popper] Updated storybook
@sashamorozov
Copy link

Much needed functionality, are there any updates? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose cross axis shifting in Popover
2 participants