Closed robintown closed 5 months ago
Another option: Floating UI
On first glance this looks really promising! It's all based on hooks rather than components, which would allow us to keep our React trees shallow, and the package includes hooks for menus, which could be an interesting alternative to Radix menus in the future as well. I say this because Radix menus have turned out to be a little inflexible when it comes to keyboard focus of custom menu elements.
@robintown Can you close the issue ? It was done in https://github.com/element-hq/compound-web/pull/156 Thanks!
(I don't have the rights in this repo)
@t3chguy's efforts to start using the Compound Web tooltip component in more places across Element Web are running into a number of roadblocks due to quirks of the Radix-based implementation:
useLayoutEffect
time anymore.aria-label
when the tooltip isn't openaria-label
, which potentially preventscaption
s from being readaria-labels
etc. and changes in testing strategy.As a result, I've begun looking into alternative component libraries that we could build our tooltip component on, in case one of them gives us an obviously easier way to move this task forward. Currently, the only other mature, unstyled React component libraries than I'm aware of are React Aria and MUI Base UI.
I have yet to investigate MUI Base UI. If that doesn't work out though, we should reconsider whether there's a way forward that still uses Radix. Implementing a tooltip component from scratch is also on the table, but I would really like to avoid this.