From 302c2c2813ca6a7285b261792de2bd0d311c8856 Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Thu, 25 Jul 2024 22:17:03 +0200 Subject: [PATCH] add message for emojis not supported on this type --- snippets/shx-3d-render-input.liquid | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 69d9ce4..d2ef885 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -570,6 +570,13 @@ setTimeout(() => { showErrorMessageIfEmojiNotSupported(document.querySelector(`#${inputID}`).value, inputID) + const event = new Event('input', { + bubbles: true, + cancelable: true, + }); + + document.querySelector(`#${inputID}`).dispatchEvent(event); + document.querySelector(`#${inputID}`).addEventListener('input', (e)=>{ if (!document.querySelector(`label[for="${inputID}-label"] span`)) { const span = document.createElement("span"); @@ -583,13 +590,7 @@ document.querySelector(`label[for="${inputID}-label"] span`).textContent = 'Bitte gib deinen Text ein'; document.querySelector(`label[for="${inputID}-label"] span`).style.color = 'red'; } -/* - const event = new Event('input', { - bubbles: true, - cancelable: true, - }); - - document.querySelector(`#${inputID}`).dispatchEvent(event); */ + showErrorMessageIfEmojiNotSupported(e.target.value, inputID) });