diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 7f50ad1..d04d4df 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -175,10 +175,6 @@ {% endcomment %} let browserSupportsTextareaTextNodes; - /** - * @param {HTMLElement} input - * @return {boolean} - */ function canManipulateViaTextNodes(input) { if (input.nodeName !== "TEXTAREA") { return false; @@ -191,11 +187,6 @@ return browserSupportsTextareaTextNodes; } - /** - * @param {HTMLTextAreaElement|HTMLInputElement} input - * @param {string} text - * @returns {void} - */ function insertText(input, text) { // Most of the used APIs only work with the field selected input.focus(); @@ -515,7 +506,6 @@ for (let key in globalInputFormsObjValues) { if (globalInputFormsObjValues[id][key] !== undefined) { shx_globalValues[key] = globalInputFormsObjValues[id][key]; - break; } } @@ -539,9 +529,12 @@ globalInputFormsObjValues[id][key] = value; } + // emoji picker element will be created by clicking the emoji function onClickEmojiPickerButton() { const emojiPickupPopup = document.getElementById("shx-emoji-picker-popup") + // checking if emoji picker already exists + // needs to be created every time the variant was changed because of rerendering all inputs if (emojiPickupPopup.childNodes.length === 0) { const emojiPicker = document.createElement("emoji-picker"); emojiPicker.classList = "light shx-emoji-picker"; @@ -626,7 +619,17 @@ // } } - function SHX_IFC_genDropdownSelect(inputID, labelText, inputName, inputVal, options, section_id) { + function loadCustomEnhancedDropdownSelectedValue() { + const selectElement = document.querySelector('.shx-custom-enhanced-dropdown-font-hide-dummy-select'); + + selectElement.value = document.getElementById('shx-custom-enhanced-dropdown-font-select-selected-value').innerText; + + // Trigger change event + const eventChange = new Event('change', { bubbles: true }); + selectElement.dispatchEvent(eventChange); + }; + + function SHX_IFC_genDropdownSelect(inputID, labelText, inputName, inputVal, options, section_id) { let html = `
@@ -643,7 +646,7 @@