Skip to content

Transitions and floating ui in anchor plugin #4105

Answered by SimoTod
awcodes asked this question in 1. Help
Discussion options

You must be logged in to vote

@awcodes it's not exactly a bug but more of an unexpected outcome of the interaction between all the various functionalities.

In reality, it behaves correctly although you probably weren't expecting that:

  • x-show applies display: none to the div so the div is considered by your browser as having width = 0px.
  • x-anchor.bottom anchors the div to the middle of the bottom border.
  • x-transition applies the duration-500 class to the div when it becomes visible.
  • duration-500 in tailwind translates to transition-duration: 500ms; which means that all CSS properties are animated.

So what happens is, when the anchored div is hidden (width = 0), the horizontal offset is exactly half of the container w…

Replies: 3 comments 3 replies

Comment options

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

@ekwoka
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@awcodes
Comment options

Answer selected by SimoTod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants