diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 9a064bd..f49921c 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -561,6 +561,8 @@ return !regex.test(text); } + let shxInfoTextTimeout = null; + function SHX_IFC_genTextInput(inputID, labelText, inputName, inputVal, section_id, maxLength = 24, emojisSupported = false) { function handleInputLabel(value) { let inputLabel = document.querySelector(`label[for="${inputID}-label"] span`) @@ -600,8 +602,12 @@ document.querySelector('#shx-info-text').style.color = '#45aaf2'; document.querySelector('#shx-info-text').innerHTML = 'Tipp: Füge Leerzeichen zwischen Text und Emojis ein, um den Text besser lesbar zu machen.'; + if (shxInfoTextTimeout) { + clearTimeout(shxInfoTextTimeout); + } + // hide the text after 8 seconds - setTimeout(() => { + shxInfoTextTimeout = setTimeout(() => { document.querySelector('#shx-info-text').style.display = 'none'; }, 8000); }