Skip to content

Issue with long elements and middlewares #1173

Answered by gabrieljablonski
zzkaa asked this question in Q&A
Discussion options

You must be logged in to vote

When using the middlewares props, you override the default middlewares the tooltip uses internally. To keep the tooltip working as expected, you need to copy the default middlewares, like so:

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

<Tooltip
  middlewares=[
    offset(10),
    flip({
      fallbackAxisSideDirection: 'start',
    }),
    shift({ padding: 5 }),
    // your custom middlewares here
  ]
/>

Quick reminder that middleware order is important, so keep it in mind in case you run into any issues.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zzkaa
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