Skip to content

Use top/left for positioning Floating UI elements #2931

Answered by chasegiunta
chasegiunta asked this question in Q&A
Discussion options

You must be logged in to vote

That could work, but custom CSS solution is not ideal, IMO. I think I figured out an easier way (for anyone else running across this issue), and that is wrapping Vue's transition component in absolute positioned parent:

<div class="absolute">
  <Transition
    enter-active-class="transition ease-out duration-100"
    enter-from-class="opacity-0 scale-95"
    enter-to-class="opacity-100 scale-100"
    leave-active-class="transition ease-in duration-75"
    leave-from-class="opacity-100 scale-100"
    leave-to-class="opacity-0 scale-95"
  >
    <Popover.Positioner>
      <Popover.Content>
       ...............

Floating UI then correctly calculates the X & Y positions

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@segunadebayo
Comment options

@chasegiunta
Comment options

Answer selected by chasegiunta
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