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

[Popover / Positioner] Add prop to customize whether to flip or to shift when there's no more space #1546

Open
benface opened this issue Mar 7, 2025 · 0 comments
Labels
new feature New feature or request

Comments

@benface
Copy link

benface commented Mar 7, 2025

Feature request

Summary

Again, this request is for Popover.Positioner, but it probably applies to the other Positioner components as well.

I noticed that when the popover reaches collisionPadding distance or less from the nearest collisionBoundary, it flips if there's enough space on the other side. That's nice, but it's not always the desired behavior. In my case, I would prefer if the popover was shifted instead, as I would rather keep the left side of the popover as close as possible to the trigger:

CleanShot.2025-03-07.at.16.06.26.mp4

Would it be possible to add a new prop to customize that behavior? Maybe something like collisionAvoidanceStrategy?: 'flip' | 'shift'?

Examples in other libraries

I believe @floating-ui itself has a few different strategies for avoiding collisions.

Motivation

Sorry, I don't know what to add that I haven't said above. :D Thank you very much!

@benface benface added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 7, 2025
@atomiks atomiks added new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants