Skip to content

Conversation

@RobinMalfait
Copy link
Member

This is done for 2 reasons:

  1. The default strategy in Floating UI was already absolute
  2. It can improve performance drastically when using transitions

The main reason we used fixed was to ensure that it wasn't accidentally positioned to another relative element. However, all components that use this FloatingProvider will also use a portal which puts elements in the <body> already so this should be safe.

If it is not safe for your application, then you can still use the fixed strategy.

This is done for 2 reasons:

1. The default strategy in Floating UI was already `absolute`
2. It can improve performance drastically when using transitions

The main reason we used `fixed` was to ensure that it wasn't
accidentally positioned to another `relative` element. However, all
components that use this `FloatingProvider` will also use a portal which
puts elements in the `<body>` already so this should be safe.

If it is not safe for your application, then you can still use the
`fixed` strategy.
@vercel
Copy link

vercel bot commented Apr 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 9:33am
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 9:33am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants