Closed ShingZtore closed 2 months ago
Disabling the edit button doesn't disable the edit panel opening on double click. The current dblClick event handler only targets contenteditable and a few element types to allow you to double click within the content editable box.
If you want to block all editing then look at hooking into the onAddFieldAfter event and set a dblClick handler on the .trumbowyg class to prevent propagating the event (currently $stage.on('dblclick', 'li.form-field') is where the event bubbles up to in order to open the edit field) or remove that event handler
Thank you!
I share my solution:
onAddFieldAfter: function(fieldId, fieldData) {
// Your code that handles reacting to the added field
$('li.trumbowyg-field').on('dblclick', function(event) {
event.stopPropagation();
});
},
Thank you. Closing.
Description:
When I set
fields : [{ label: "html", id: "htmlTextArea", type: "trumbowyg", }]
AnddisabledFieldButtons: { trumbowyg: ['edit'] // disables the edit button for select fields },
Environment Details:
Expected Behavior
Double click anywhere should not open the Edit.
Actual Behavior
Double-click trumbowyg plugin auto open the Edit.
Steps to Reproduce
Screenshot - (optional)