Skip to content

Ability to provide a callback function to metabind button #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
vitalybe opened this issue May 14, 2025 · 0 comments
Open
3 tasks done

Ability to provide a callback function to metabind button #580

vitalybe opened this issue May 14, 2025 · 0 comments
Labels
feature request New feature or request

Comments

@vitalybe
Copy link

Please fill out these Check-boxes

  • I checked for existing similar feature requests
  • I have read the docs and checked that the feature I am requesting is not already implemented
  • My feature request consists of only one feature

Is your Feature Request related to a Problem or Annoyance?

Metabind buttons are great when you use them from markdown but if I want to use them from API then the fact that I can't connect them to a simple javascript callback is very annoying. Sure I can use evaluate or give them source file path, but I am already in code, it'd be much simpler to just give it a callback.

Describe the Feature you'd like

Give me a simple way to invoke callback, e.g.:

{
          type: ButtonActionType.JS_CALLBACK,
          value: () => { console.log("Hello world!")
}

Alternatives

The following types are as close as we can get:

  • inlineJS
  • js

Which is not ideal, especially if you want to share some context between your code and the button callback

Additional Context

No response

@vitalybe vitalybe added the feature request New feature or request label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant