Skip to content

How to prevent the tooltip from overlapping the navigation bar? #1135

Discussion options

You must be logged in to vote

By default, the tooltip also uses the shift() middleware, which I didn't include. This should fix the issue with the margin.

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

<Tooltip
  middlewares={[offset(10), flip({ padding: 50 }), shift({ padding: 5 })]}
/>

As for your question about top padding, while I do understand what you mean, it doesn't exactly make sense in this case since that's not how the overflow works. I believe it should work as-is for your use case, but if not, try reading the floating-ui docs and see if there's anything there that might help you.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@albertothedev
Comment options

@gabrieljablonski
Comment options

Answer selected by albertothedev
@albertothedev
Comment options

@albertothedev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants