tinymce-vue icon indicating copy to clipboard operation
tinymce-vue copied to clipboard

Dynamically generate custom menu items

Open nhatimme opened this issue 2 years ago • 3 comments

What is the current behavior? Currently we have created a function inside fetch. Which should generate a array of objects.

Please provide the steps to reproduce and if possible a minimal demo of the problem https://codesandbox.io/s/tinymce-vue-y504od

Click on the button "My button" and check console. Now I get the following errors:

Unknown item in general menu 
{value: "generated-menu-item_7770287682291661522230581", type: "menuItem", text: "[customer_firstname]"}
Unknown item in general menu 
{value: "generated-menu-item_1540549822281661522230581", type: "menuItem", text: "[customer_lastname]"}

What is the expected behavior? In my opinion it should provide me the list which is created from the function CreateShortcodes.

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-vue? 6.0.2

nhatimme avatar Aug 26 '22 13:08 nhatimme

Ref: INT-2999

exalate-issue-sync[bot] avatar Aug 26 '22 13:08 exalate-issue-sync[bot]

Any solution guys? Can't go further with the projects.

nhatimme avatar Sep 20 '22 13:09 nhatimme

@nhatimme your problem here is that you have a typo... if you change menuItem to menuitem with all lowercase it should fix the issue. You'll see it uses a lowercased version in the docs for the menubutton as well, see https://www.tiny.cloud/docs/tinymce/6/custom-menu-toolbar-button/

lnewson avatar Sep 21 '22 11:09 lnewson

Closing as resolved

jscasca avatar Oct 12 '22 07:10 jscasca