pell icon indicating copy to clipboard operation
pell copied to clipboard

Suggestion: allow the custom action icon to be a function

Open meduzapat opened this issue 4 years ago • 1 comments

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).

meduzapat avatar Apr 12 '21 05:04 meduzapat

Ah, very interesting and a good idea. Thanks @meduzapat

jaredreich avatar Apr 12 '21 17:04 jaredreich