logoalt Hacker News

nicoburnslast Monday at 2:10 PM1 replyview on HN

It looks like HTML may be getting the ability to manipulate the class/attributes of elements in response to clicks (declaratively, without JS). Which would solve a lot of the interactivity issues (checkbox hack, etc).

See: https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Com...


Replies

araeslast Monday at 11:34 PM

Thanks. Saw this, thought it looked cool. Just could not find what it can do other than "popover" "popovertarget" without using JS.

The examples provided for custom events all seem to use JS anyways. Ex:

  <button commandfor="the-image" command="--rotate-landscape">

  ...

  if ( event.command == "--rotate-landscape" ) { image.style.rotate = "-90deg" }
Agree it would be cool, it just doesn't seem to do a lot. Generalized "popovertarget" except that basically means +modal <dialog> in most of the examples. And all the modal dialogs are almost always "popover". And you can already make "popover" appear over "popover" with multiple onscreen. Maybe there's something with looking. [1]

[1] https://developer.chrome.com/blog/command-and-commandfor

Edit: Here's an example of the overlapping popover functionality. https://araesmojo-eng.github.io/

Main Page -> General Tests Menu -> Open Popover 1 | Open Popover 2

Should both open popovers simultaneously on top of each other while dismissing neither, and also change the state of elements on the page at the same time.