Repository navigation
Description
Description
The popover attribute allows creating dropdown UIs using platform features, solving the case of a dropdown being cut by the overflow behavior of the container (as it goes in the top layer) and without requiring JS to trigger it (thanks to popovertarget.
This is already implemented in Blink and is partially implemented in Webkit. Reaching interop would allow relying on it.
Thus, due to the top-layer behavior, it is hard (or maybe even impossible) to polyfill this feature.
Specification
https://html.spec.whatwg.org/multipage/popover.html#the-popover-attribute
Open Issues
No response
Tests
https://wpt.fyi/results/html/semantics/popovers?label=master&label=experimental&aligned
Maybe also https://wpt.fyi/results/close-watcher/popover-closewatcher.html?label=master&label=experimental&aligned and https://wpt.fyi/results/close-watcher/popover-closewatcher-multiple-plus-free.html?label=master&label=experimental&aligned but not sure about them
Current Implementations
- Blink
- Gecko
- WebKit
Standards Positions
mozilla/standards-positions#698
Browser bug reports
https://bugzilla.mozilla.org/show_bug.cgi?id=1808823
https://bugs.chromium.org/p/chromium/issues/detail?id=1307772
https://bugs.webkit.org/show_bug.cgi?id=250171
Developer discussions
No response
Polls & Surveys
No response
Existing Usage
No response
Workarounds
No response
Accessibility Impact
No response
Privacy Impact
No response
Other
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
foolip commentedon Sep 15, 2023
cc @stubbornella @mfreed7 @una
nt1m commentedon Sep 17, 2023
WebKit implements everything except
popover=hint, which does not have a spec yet (hence isn't eligible for Interop 2024).[-]popovers[/-][+]Popover[/+]mfreed7 commentedon Sep 29, 2023
I agree with this part, with the caveat that we've got a spec PR open now to add
popover=hintbehavior. I'd love to get that reviewed and then add it to Interop 2024 if that's still possible!foolip commentedon Oct 5, 2023
In preliminary results for State of HTML 2023, popover was the most common response to the freeform question "Which existing HTML features or browser APIs are you unable to use because of browser differences or lack of support?" See #550 for details.
lukewarlow commentedon Oct 12, 2023
https://bugs.webkit.org/show_bug.cgi?id=263081 - This is an example of an interop bug with Popover implementations.
nt1m commentedon Oct 12, 2023
Someone would need to write a WPT for it
foolip commentedon Oct 25, 2023
Also from State of HTML preliminary results, Popover was the feature that respondents expressed the most interest for. Note that this wasn't freeform, it's based on the features the survey asked about experience and sentiment for.
LeaVerou commentedon Oct 25, 2023
@foolip You're burying the lede a little bit 😅 Popover came up all over the survey, in freeform and non-freeform questions. The need for native popovers was probably one of the biggest themes (2nd only after stylability IMO).
Most interesting known features (not freeform)
Out of the respondents who had heard each feature, what % were interested?
Popover is the first, with 52% of those who had heard it but not used it selecting that they were interested!
Most interesting unknown features (not freeform)
Out of the respondents who had not heard each feature, what % were interested?
46% of people who had not even heard of the Popover API before the survey selected they were interested.
Top interop pain points
2700 issues / 1755 responses, manually classified
Popover is the first one, occupying almost 10% of all complaints!
Unable to use for other reasons
Popover is 6th here too, despite not really being relevant (since it's not yet supported really). I suspect people misread the questions and entered things that would be more relevant in the question above (i.e. due to browser support)
Top interactivity pain points (freeform)
12th most common complaint was related to the lack of popovers.
foolip commentedon Oct 26, 2023
Thank you @LeaVerou for summarizing with nice screenshots!
jensimmons commentedon Oct 31, 2023
Could someone create a link to the tests that will likely be included, without any of
popover=hint, (since it does not have a spec yet and therefore is not eligible for Interop 2024).mfreed7 commentedon Oct 31, 2023
The OP contains the correct link to the tests: https://wpt.fyi/results/html/semantics/popovers?label=master&label=experimental&aligned
I tried, and failed, to come up with a search term that eliminates the tests that end in
.tentative.html, but wpt.fyi's search syntax is... different than I'm used to. I did verify that all popover tests that use/test non-standard features (includingpopover=hintand anchor positioning) are correctly marked with.tentative.html.gsnedders commentedon Nov 6, 2023
https://wpt.fyi/results/html/semantics/popovers?label=master&label=experimental&aligned&q=not%20is%3Atentative does that.
41 remaining items
Split out popover tests using `anchor` into tentative test
Split out popover tests using `anchor` into tentative test
Split out popover tests using `anchor` into tentative test
Split out popover tests using `anchor` into tentative test
Bug 1881091 [wpt PR 44679] - Split out popover tests using `anchor` i…
promocot commentedon Mar 23, 2024
::backdrop not supported css variable!
Example
::backdrop {
background: oklch(11.63% .045 var(--prm-hue) / 80%);
backdrop-filter: var(--blur-1);
}
Variables won't work! If to change on
::backdrop {
background: oklch(11.63% .045 282 / 80%);
backdrop-filter: blur(4px);
}
all will be works
foolip commentedon Mar 23, 2024
@promocot if you're running into this issue in Chrome, it was fixed in https://chromestatus.com/feature/4875749691752448, in Chrome 122.
https://wpt.fyi/results/html/semantics/interactive-elements/the-dialog-element/backdrop-inherits.html?label=master&label=stable is the relevant test for this, and it looks like it was previously failing (but now passing) in Safari as well.
If you have a problem in the latest version of each browser, please file bug reports in the appropriate bug tracker.
promocot commentedon Mar 23, 2024
Hello, thanks, I tried to update manual my chrome browser, and yep after works, but i found another bug with close popover on clic to icon. For example, I have a HTML
If I click on show button i will see popup, if i click on hide button i will close popup, but if i have structure like this
when i click on show button i will see popup, and if i try to click on the hide button, nothing happens
foolip commentedon Mar 24, 2024
@promocot I see you're missing a
</button>in that second example, but with or without it still works in my testing, clicking "Hide popover" closes it.If you have more question please try Stack Overflow, and if you think there are browser bugs file a bug with the appropriate browser.
This issue was to track popover for inclusion in Interop 2024, and is not a good place to ask for help with popover.
promocot commentedon Mar 24, 2024
I am not missing the button in the second example, I place the button inside the popover as a close button. I tested in chrome. Ok i will try to write email for chrome developers
promocot commentedon Mar 24, 2024
I found a problem, in my test case i used attribute for SVG icon not button
but if I add a button with an icon, and set the attribute for the button, all works
foolip commentedon Mar 24, 2024
@promocot that's interesting, do you mean you were trying to add the
popovertargetorpopovertargetactionattributes to an SVG element? This probably doesn't work the way the spec is written, can you file an issue at https://github.com/whatwg/html/issues with a code sample of what you were attempting?promocot commentedon Mar 25, 2024
Yes, I will write about this with a video demo and codeopen
Split out popover tests using `anchor` into tentative test
Bug 1881091 [wpt PR 44679] - Split out popover tests using `anchor` i…