Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Allow [up-emit] on buttons #416

Copy link
Copy link
@triskweline

Description

@triskweline
Issue body actions

Discussed in #411

Originally posted by outcassed August 9, 2022
Would it be possible to have unpoly either honor up-emit on <button>s or expose the up-emit click event handler so that it can be easily extended?

--- unpoly.js
+++ unpoly-patch.js
@@ -11642,6 +11642,7 @@
     //    abort = -> up.emit(signal, 'abort')
     //    [abort, signal]
     on('up:click', 'a[up-emit]', executeEmitAttr);
+    on('up:click', 'button[up-emit]', executeEmitAttr);
     on('up:framework:reset', reset);
     return {
         on,
@@ -11654,7 +11655,8 @@
         halt,
         isUnmodified,
         fork,
-        keyModifiers
+        keyModifiers,
+        executeEmitAttr
     };
 })();
 up.on = up.event.on;
```</div>
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.