Live data from Hacker News

Popover API

developer.mozilla.org

21–30 of 166 posts

Re: Popover API

#21

I absolutely see the need for this if implemented in concert with the host OS windowing system, because current popovers must be emulated in a way that does not always work well. For example, a browser-native today will be able to expand beyond the borders of the hosting browser window, so you can don't have to worry about it getting clipped to the window borders, but a fancy emulated select from toolkit like Quasar…

How useful is such a feature in reality? On smaller devices, the web brower almost always covers the whole screen, and even on big monitors, it usually touches at least one corner.

Re: Popover API

#22

I absolutely see the need for this if implemented in concert with the host OS windowing system, because current popovers must be emulated in a way that does not always work well. For example, a browser-native today will be able to expand beyond the borders of the hosting browser window, so you can don't have to worry about it getting clipped to the window borders, but a fancy emulated select from toolkit like Quasar…

I don’t see web apps getting the native windowing system integration you envision anytime soon. The fact that some standard controls behave that way is an OS-specific implementation side effect of them being implemented as OS-native, which they aren’t required to be.

Re: Popover API

#23
post #11

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

I'd warn that there's a fair bit of work you have to do to get animations and typical modal behavior working up to the level of modern day expectations. It's completely surmountable but also quite non-trivial.

Re: Popover API

#24

Kinda funny that browsers have built-in pop-up blockers, but then create APIs like this. Yes I know the difference, but still. I’m old enough to remember the pop-up and pop-under wars of the late 90s and early 2000s. I guess we won that particular battle, but the war for our attention is far from over.

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.

Re: Popover API

#25
As someone who does some (but not a lot of) web development, I guess the only thing I care about is: can I turn this off with uBlock Origin?

Re: Popover API

#26
post #5
post #3

This sounds cool, but why does this page not have any images showing what a 'popover' is?

That would be useful. They do link to these interactive examples - looks like the default styles for popovers are not very exciting: https://mdn.github.io/dom-examples/popover-api/

Default styles only make things harder to customize. If we didn't have so many useless/ugly default styles, we wouldn't need reset.css/normalize.css

Re: Popover API

#27
post #25

As someone who does some (but not a lot of) web development, I guess the only thing I care about is: can I turn this off with uBlock Origin?

Nope. Not if the pop-up is first party.

Re: Popover API

#29

I absolutely see the need for this if implemented in concert with the host OS windowing system, because current popovers must be emulated in a way that does not always work well. For example, a browser-native today will be able to expand beyond the borders of the hosting browser window, so you can don't have to worry about it getting clipped to the window borders, but a fancy emulated select from toolkit like Quasar…

It will also make it semantically easier to detect. I'm thinking about accessibility and crawlability but also in case anyone wants to write some "no popup" plugin.

Re: Popover API

#30

Kinda funny that browsers have built-in pop-up blockers, but then create APIs like this. Yes I know the difference, but still. I’m old enough to remember the pop-up and pop-under wars of the late 90s and early 2000s. I guess we won that particular battle, but the war for our attention is far from over.

I've seen exactly this comment somewhere on HN already. What's going on?
Post reply on HN