react-ui-org / react-ui

React UI is a themeable and performant UI library for React apps.
https://react-ui.io
MIT License
21 stars 7 forks source link

Misplaced `Popover` when used with Floating UI #566

Open adamkudrna opened 2 months ago

adamkudrna commented 2 months ago

I found out the advanced positioning is now broken. It is not related to this PR and it was already broken before, but if you could fix it here, it would be great. Otherwise let's file a separate issue for it.

Image

https://github.com/react-ui-org/react-ui/pull/559#discussion_r1743774576

atmelmicro commented 1 week ago

This happens because transferProps disallows the prop style which is needed for Floating UI to work properly. Wrapping the popover in a div does not help because the dimensions of the div are 0x0. Making it work without passing style would require a lot of ugly tweaks on the user side.

I have 2 solutions in mind.

  1. Allow the prop style to be passed
  2. Make a new prop for floating ui and pass only top, left, and position

The 2nd one would discourage abusing the style prop, but some other libraries may need more props to work

mbohal commented 5 days ago

On video call we agreed, that we want a new prop position to pass the position info.