6

button invoketarget=”share”

 9 months ago
source link: https://adactio.com/journal/20714
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

button invoketarget=”share”

December 12th, 2023

I’ve written quite a bit about how I’d like to see a declarative version of the Web Share API. My current proposal involves extending the type attribute on the button element to support a value of “share”.

Well, maybe a different attribute will end up accomplishing what I want! Check out the explainer for the “invokers” proposal over on Open UI. The idea is to extend the button element with a few more attributes.

The initial work revolves around declaratively opening and closing a dialog, which is an excellent use case and definitely where the effort should be focused to begin with.

But there’s also investigation underway into how this could be away to provide a declarative way of invoking JavaScript APIs. The initial proposal is already discussing the fullscreen API, and how it might be invoked like this:

button invoketarget="toggleFullsceen"

They’re also looking into a copy-to-clipboard action. It’s not much of a stretch to go from that to:

button invoketarget="share"

Remember, these are APIs that require a user interaction anyway so extending the button element makes a lot of sense.

I’ll be watching this proposal keenly. I’d love to see some of these JavaScript cowpaths paved with a nice smooth coating of declarative goodness.

4:52pm

Tagged with invokers invoketarget html markup declarative buttons types browsers standards gestures apis share sharing fullscreen copy frontend development

Older »

Have you published a response to this? Let me know the URL:

Responses

Jay

# Posted by Jay on Tuesday, December 12th, 2023 at 6:57pm

Jason McNeill

@adactio Some adware is going to come along and do this though:

document.querySelectorAll(“button”).forEach((item) => item.addAttribute(“invoketarget”, “share”));

# Posted by Jason McNeill on Tuesday, December 12th, 2023 at 8:28pm

7 Shares

# Shared by Fynn Becker on Tuesday, December 12th, 2023 at 7:06pm

# Shared by Johannes Odland on Tuesday, December 12th, 2023 at 7:36pm

# Shared by Nicolas Hoizey on Tuesday, December 12th, 2023 at 7:36pm

# Shared by westbrook on Tuesday, December 12th, 2023 at 7:52pm

# Shared by Joe Gaffey on Tuesday, December 12th, 2023 at 8:36pm

# Shared by Kristján @ home on Tuesday, December 12th, 2023 at 10:32pm

# Shared by GenXJamerican 🇯🇲 🇺🇸 on Tuesday, December 12th, 2023 at 11:08pm

10 Likes

# Liked by Johannes Odland on Tuesday, December 12th, 2023 at 7:06pm

# Liked by Fynn Becker on Tuesday, December 12th, 2023 at 7:06pm

# Liked by Andy Davies on Tuesday, December 12th, 2023 at 7:36pm

# Liked by tbeseda on Tuesday, December 12th, 2023 at 7:36pm

# Liked by Joe Gaffey on Tuesday, December 12th, 2023 at 8:05pm

# Liked by Harry Brignull on Tuesday, December 12th, 2023 at 8:05pm

# Liked by Thomas Broyer on Tuesday, December 12th, 2023 at 8:36pm

# Liked by The Spicy Web on Tuesday, December 12th, 2023 at 8:36pm

# Liked by Jason Neel on Tuesday, December 12th, 2023 at 10:30pm

# Liked by Wesley Soares on Tuesday, December 12th, 2023 at 10:32pm


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK