From dedee9af47499159a3c0c34577db1b55792ea122 Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Tue, 16 Jul 2024 22:08:11 +0200 Subject: [PATCH] emoji picker --- snippets/shx-3d-render-input.liquid | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 128e28e..a2ef5cf 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -407,6 +407,21 @@ globalInputFormsObjValues[id][key] = value; console.log("SHX_IFC_setCurrentValue", id, key, value) + + // add the element after the text input is rendered + if (key === "text1") { + const emojiPicker = document.createElement("emoji-picker") + emojiPicker.classList = "light" + emojiPicker.style.width = "100%" + + emojiPicker.addEventListener("emoji-click", (e) => { + insertText(document.querySelector("#shx-text1"), e.detail.unicode); + }); + + console.log("add picker here") + + document.getElementsByClassName("shx-emoji-picker-popup")[0].appendChild(emojiPicker) + } } function SHX_IFC_genTextInput(inputID, labelText, inputName, inputVal, section_id, maxLength = 24) { @@ -1059,8 +1074,8 @@ window.addEventListener("DOMContentLoaded", () => { setTimeout(() => { + /* console.log("timeout") - const emojiPicker = document.createElement("emoji-picker") emojiPicker.classList = "light" emojiPicker.style.width = "100%" @@ -1072,7 +1087,7 @@ console.log("add picker") document.getElementsByClassName("shx-emoji-picker-popup")[0].appendChild(emojiPicker) - + */ /*