You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/website/src/routes/docs/headless/(components)/popover/index.mdx
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,13 @@ A popover is a **non-modal** UI element that creates overlays around a DOM eleme
28
28
29
29
This is particularly useful for displaying additional information or options without navigating away from the current context. It is also a **native replacement for [portals](https://qwik.builder.io/docs/cookbook/portal/#portal)**, which are commonly used in other JavaScript frameworks.
30
30
31
-
> A common use case for a popover, is preventing overflow issues within your UI. The popover API guarantees that your content remains above the rest of the page.
31
+
> An example use case for a popover, is preventing overflow issues within your UI. The popover API guarantees that your content remains above the rest of the page.
32
32
33
-
Most importantly, this API is a foundation for other headless components.
33
+
Most importantly, this API is a foundation for other headless components. Qwik UI is one of the first *(if not the first)* headless libraries to align with the specification. The content inside of Qwik UI popovers are also natively resumable.
34
34
35
-
## Example use cases
35
+
## Versatile Use Cases
36
36
37
-
Here are a couple of example components where the Popover API can be used. Including other parts of Qwik UI headless. Throughout the part of the documentation, we will show the Combobox being used as an example.
38
-
39
-
The content inside of Qwik UI popovers are resumable and built with Qwik in mind.
37
+
Here are a couple of example components where the Popover API can be used. Including other parts of Qwik UI headless. Throughout the documentation, we will show the Combobox being used as an example.
40
38
41
39
<AnatomyTable
42
40
propDescriptors={[
@@ -75,3 +73,10 @@ The content inside of Qwik UI popovers are resumable and built with Qwik in mind
75
73
]}
76
74
/>
77
75
76
+
## Caveats
77
+
78
+
1. The polyfill for the native popover's `:popover-open` pseudo selector uses the `.popover-open` CSS class instead. This class is added to any open popover. With that said, both can be selected using the native way.
79
+
80
+
2. Styling a popover using .popover-open needs a separate declaration. Using :popover-open in CSS that doesn't support native popover will result in an invalid selector.
81
+
82
+
3. For **native invokers** (buttons or inputs using the popovertarget attribute) on `popover=auto`, the polyfill sets the `aria-expanded` attribute to render them in the accessibility tree as elements with expanded.
0 commit comments