Live data from Hacker News

Popover API

developer.mozilla.org

81–90 of 166 posts

Re: Popover API

#81
post #75
post #57

Earlier quoted context omitted.

Two year old iPhones are absolutely able to upgrade to iOS 17 and receive this feature, all the way back to iPhone 8. That said, I do wish Apple had their browser set up like Google does with a complete upgrade possible via the App Store. It feels unnecessary to completely tie it to the OS version.

I don't know how iOS works but if it was an app would other browsers be able to use Safari's rendering engine? There is also the lower functionality JS engine that Apple forces those browsers to use (if I'm not mistaken.)

The way it works on Android is that the system web view is an "app" (though not one you can launch) that updates via the Play Store. Any app using webviews automatically gets the upgraded experience whenever that app gets upgraded.

Re: Popover API

#82

> Popovers created using the Popover API are always non-modal. If you want to create a modal popover, a element is the right way to go. Why? This is a legitimate use case for a popover. Especially if you're blurring the background while it's open. Why even offer that feature if a user's click can potentially trigger an action on some blurred out button. *edit: Apparently, you can combine the two: > You can turn a ele…

Probably, among other things, because existed much earlier.

Re: Popover API

#83
post #11

There is also ( https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di... ) if you want modal dialogs.

As someone pointed out, it's indeed harder to animate but it's fully accessible, supports escape key to close, has a built-in backdrop and has built-in focus trap. Safari took a while to support it but now it's available everywhere. I think it's better than using a tag.

Apparently it's unsupported in the Firefox ESR version in Ubuntu 20.04, which still receives support from Canonical until 2025. I found that out because someone reported that my site didn't work.

Re: Popover API

#84
post #50

Earlier quoted context omitted.

This is not a pop-up. People hate popups because they're intrusive and have their own window. This API replaces div modals and saves time and code for developers.

No, people hate pop ups because they steal focus and draw attention away from the content they’re interested in. Whether it’s a pop up or a popover, a prompt asking me to sign up to your newsletter is not something I want.

Both things are true. Popups are more disruptive because they remain even after the page that spawned them is closed and often obscure their origin.

Re: Popover API

#85

I think the Popover API will be really transformative when CSS Anchor Positioning[1] arrives as well. Anchor positioning will let you position elements relative to others on the page. Combined with the Popover API it will let you implement things like custom tooltips and context menus in a declarative way and without any need for libraries like PopperJS [2] [1] https://developer.chrome.com/blog/tether-elements-to-eac…

I'm amazed that in 2024 html/css doesn't have a tooltip attribute like there is for title

Re: Popover API

#86

I think the Popover API will be really transformative when CSS Anchor Positioning[1] arrives as well. Anchor positioning will let you position elements relative to others on the page. Combined with the Popover API it will let you implement things like custom tooltips and context menus in a declarative way and without any need for libraries like PopperJS [2] [1] https://developer.chrome.com/blog/tether-elements-to-eac…

[deleted]

Re: Popover API

#87

These are popovers: https://kagi.com/proxy/passover-popovers-6.jpg?c=gBnCtLe1QYl... No you can't have that word to mean something else, it's sacred. And because you tried you can't have any of my popovers either.

They're Yorkshire Puddings ;)

Re: Popover API

#88

I suspect this isn't going to get major usage. Making it a dedicated API makes these things easier to target by extensions and thus easier to block. There are legitimate usages but almost all of the ones I encounter are marketing call to actions and invasive support chat boxes which are both almost universally hated and would the target of those blocking action.

When I first read about this API a while back, I thought the same thing. But it's perfect for adding complex controls on top of inputs when you have limited real estate (e.g. clicking on an input with a font name and showing a font picker popover with a preview of the font). This is obviously possible today without this API, but I like that they added something semantic. I regularly have to wade through the ARIA docs to figure out which role/aria- attributes to use.

Re: Popover API

#89
post #87

These are popovers: https://kagi.com/proxy/passover-popovers-6.jpg?c=gBnCtLe1QYl... No you can't have that word to mean something else, it's sacred. And because you tried you can't have any of my popovers either.

They're Yorkshire Puddings ;)

[deleted]

Re: Popover API

#90

I think the Popover API will be really transformative when CSS Anchor Positioning[1] arrives as well. Anchor positioning will let you position elements relative to others on the page. Combined with the Popover API it will let you implement things like custom tooltips and context menus in a declarative way and without any need for libraries like PopperJS [2] [1] https://developer.chrome.com/blog/tether-elements-to-eac…

I'm amazed that in 2024 html/css doesn't have a tooltip attribute like there is for title

Does the "title" attribute not work? I tried adding one to the containing your post and it worked. I assume that's non-standard.
Post reply on HN