Skip to content

Disable auto position when using place? #1127

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

Closed
thomas-hogan opened this issue Nov 27, 2023 · 2 comments
Closed

Disable auto position when using place? #1127

thomas-hogan opened this issue Nov 27, 2023 · 2 comments
Labels

Comments

@thomas-hogan
Copy link

Currently I am using place="bottom-start" and it works as expected. When the anchor element is towards the bottom of the screen the tooltip opens above. Is there a way to disable that auto positioning and have the tooltip always open bottom-start regardless of where it is on the screen?

@gabrieljablonski
Copy link
Member

Hi @thomas-hogan.

Although we don't have an explicit way of doing this, you can achieve it by using customizing the middlewares prop. Here's an explanation from a previous issue.

As explained there, what you probably want to do is remove both shift() and flip(), so you'll end up with something like this

import { offset } from '@floating-ui/dom'

<Tooltip
  middlewares={[offset(10)]}
/>

@thomas-hogan
Copy link
Author

Thanks, that did the trick!

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

No branches or pull requests

2 participants