radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
14.82k stars 717 forks source link

Move components to popover API #2941

Open Bricklou opened 3 weeks ago

Bricklou commented 3 weeks ago

Feature request

Overview

The Popover API is now widely supported. Components like dropdown, tooltip, context menu and others should migrate to it.

Why? Because it would allow use to take advantage of the #top-layer context without having to bother about having a z-index issue on our components. Plus, popover can compute screen border by themselves, which means there would be less JS computation to fix offscreen problems.

Who does this impact? Who is this for?

This would concern everything radix user, and obviously, might be a breaking change to many of them. But on the other hand, it would use supported browser features instead of custom JS behaviour to compute the rendering.

JasonColeyNZ commented 1 week ago

If the popover api is used then the @oddbird/popover-polyfill can be used for older browsers, I think this is what Github are using for their popovers now.