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

Add x-anchor.noflip modifier #4382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aguingand
Copy link

This PR adds ability to disable auto flipping for anchor. In some cases you want to force the anchored element to stay at his position and not flipping to the top if there is no enough room below. For example with large menus or popovers teleported to body.

Usage :

<div x-anchor.noflip>
</div>

<!-- with position -->
<div x-anchor.bottom-start.noflip>
</div>

@ekwoka
Copy link
Contributor

ekwoka commented Sep 30, 2024

Is there a way to add a test for this?

@aguingand
Copy link
Author

@ekwoka I see no easy way to test this, the logic is almost entirely in @floating-ui/dom. Current e2e test is minimalist.

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.

2 participants