add message for emojis not supported on this type
parent
ec27a08ebc
commit
158cbde63a
|
@ -567,7 +567,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
function createInputLabelIfNotExists(inputID) {
|
||||
if (!document.querySelector(`label[for="${inputID}-label"] span`)) {
|
||||
const span = document.createElement("span");
|
||||
span.style.marginLeft = `10px`
|
||||
document.querySelector(`label[for="${inputID}-label"]`).appendChild(span)
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
createInputLabelIfNotExists(inputID)
|
||||
|
||||
showErrorMessageIfEmojiNotSupported(document.querySelector(`#${inputID}`).value, inputID)
|
||||
/*
|
||||
const event = new Event('input', {
|
||||
|
@ -578,11 +588,13 @@
|
|||
document.querySelector(`#${inputID}`).dispatchEvent(event); */
|
||||
|
||||
document.querySelector(`#${inputID}`).addEventListener('input', (e) => {
|
||||
if (!document.querySelector(`label[for="${inputID}-label"] span`)) {
|
||||
createInputLabelIfNotExists(inputID)
|
||||
|
||||
/*if (!document.querySelector(`label[for="${inputID}-label"] span`)) {
|
||||
const span = document.createElement("span");
|
||||
span.style.marginLeft = `10px`
|
||||
document.querySelector(`label[for="${inputID}-label"]`).appendChild(span)
|
||||
}
|
||||
} */
|
||||
document.querySelector(`label[for="${inputID}-label"] span`).style.display = `inline`
|
||||
document.querySelector(`label[for="${inputID}-label"] span`).style.color = null;
|
||||
document.querySelector(`label[for="${inputID}-label"] span`).textContent = e.target.value.length + ' von ' + maxLength + ' Zeichen verwendet';
|
||||
|
|
Loading…
Reference in New Issue