Expand my Community achievements bar.

The new custom Input plugin(RTE) is not allowing to add text, when clicked the dependent div is getting closed.

Avatar

Level 2

window["Coral"]["templates"]["RichTextEditor"]["InputPlugin"] = (function anonymous(data_0 /**/) {  var frag = document.createDocumentFragment(); var data = data_0; var el13 = document.createElement("div"); el13.style.display = "table-cell"; el13.style.vertical_align = "middle"; el13.style.padding = "0.25rem"; el13.style.line_height = "2.375rem"; el13.className += " rte-dialog-columnContainer"; var el14 = document.createTextNode("\n "); el13.appendChild(el14); var el15 = document.createElement("div"); el15.className += " rte-dialog-column"; var el16 = document.createElement("label"); var el17 = document.createTextNode(" "); el16.appendChild(el17); var el18 = document.createElement("input","coral-textfield"); el18.style.z_index = "10000 !important"; el18.setAttribute("is", "coral-textfield"); el18.setAttribute("data-action", "munged"); // el18.setAttribute("data-type", "hu"); // el18.setAttribute("value", ""); el16.appendChild(el18); var el19 = document.createTextNode(" "); el16.appendChild(el19); el15.appendChild(el16); var el20 = document.createTextNode(" "); el15.appendChild(el20); el13.appendChild(el15); var el21 = document.createTextNode("\n"); el13.appendChild(el21); frag.appendChild(el13); var el22 = document.createTextNode("\n"); frag.appendChild(el22); var el43 = document.createTextNode("\n "); el13.appendChild(el43); var el44 = document.createElement("div"); el44.style.display = "table-cell"; el44.style.vertical_align = "middle"; el44.style.padding = "0.25rem"; el44.style.line_height = "2.375rem"; el44.className += " rte-dialog-column rte-dialog-column--rightAligned"; var el45 = document.createTextNode("\n "); el44.appendChild(el45); var el46 = document.createElement("button","coral-button"); el46.setAttribute("is", "coral-button"); el46.setAttribute("icon", "close"); el46.setAttribute("title", CUI["rte"]["Utils"]["i18n"]('dialog.cancel')); el46.setAttribute("aria-label", CUI["rte"]["Utils"]["i18n"]('dialog.cancel')); el46.setAttribute("iconsize", "S"); el46.setAttribute("type", "button"); el46.setAttribute("data-type", "cancel"); el46.setAttribute("tabindex", "0"); el44.appendChild(el46); var el47 = document.createTextNode("\n "); el44.appendChild(el47); var el48 = document.createElement("button","coral-button"); el48.setAttribute("is", "coral-button"); el48.setAttribute("icon", "check"); el48.setAttribute("title", CUI["rte"]["Utils"]["i18n"]('dialog.apply')); el48.setAttribute("aria-label", CUI["rte"]["Utils"]["i18n"]('dialog.apply')); el48.setAttribute("iconsize", "S"); el48.setAttribute("variant", "primary"); el48.setAttribute("type", "button"); el48.setAttribute("data-type", "apply"); el48.setAttribute("tabindex", "0"); el44.appendChild(el48); var el49 = document.createTextNode("\n "); el44.appendChild(el49); el13.appendChild(el44); var el50 = document.createTextNode("\n"); el13.appendChild(el50); frag.appendChild(el13); var el51 = document.createTextNode("\n"); frag.appendChild(el51); return frag; });

2 Replies

Avatar

Community Advisor

Hi @swathialeti 

 

when you say new custom input plugin, are you referring any custom code here? Or is this OOTB rich text editor?

 

Using the cq/gui/component/authoring/dialog/richtext resourceType it works perfectly fine and I do not see any issue.

 

Thanks!

Avatar

Level 2

Hi @Asutosh_Jena_  
I'm trying to create a new plugin same like anchor plugin and the new custom plugin should not have any link functionality, it should only accept the text in input field. So i have added above JS code to the newly created plugin but when i click on input field to add text it is getting closed.

swathialeti_0-1633931116954.png