Skip to content

Suggestion: allow the custom action icon to be a function #213

@meduzapat

Description

@meduzapat

Amazing work !
Just a little suggestion:
action.icon<string| function> (optional if overwriting, required if custom action)
If the icon element is a string or is null do the normal way, but if is a function use the return string as element

that way we can create custom buttons, like a color picker
I am doing this right now:

{
    icon: '<input type="color" class="pell-button" onchange="document.execCommand(\'backColor\', false, this.value);"/>',
    title: 'Change Background Color',
    result: () => true
},

this works fine but is a nasty workaround (input inside button).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions