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(() => {
|
setTimeout(() => {
|
||||||
|
createInputLabelIfNotExists(inputID)
|
||||||
|
|
||||||
showErrorMessageIfEmojiNotSupported(document.querySelector(`#${inputID}`).value, inputID)
|
showErrorMessageIfEmojiNotSupported(document.querySelector(`#${inputID}`).value, inputID)
|
||||||
/*
|
/*
|
||||||
const event = new Event('input', {
|
const event = new Event('input', {
|
||||||
|
@ -577,12 +587,14 @@
|
||||||
|
|
||||||
document.querySelector(`#${inputID}`).dispatchEvent(event); */
|
document.querySelector(`#${inputID}`).dispatchEvent(event); */
|
||||||
|
|
||||||
document.querySelector(`#${inputID}`).addEventListener('input', (e)=>{
|
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");
|
const span = document.createElement("span");
|
||||||
span.style.marginLeft = `10px`
|
span.style.marginLeft = `10px`
|
||||||
document.querySelector(`label[for="${inputID}-label"]`).appendChild(span)
|
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.display = `inline`
|
||||||
document.querySelector(`label[for="${inputID}-label"] span`).style.color = null;
|
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';
|
document.querySelector(`label[for="${inputID}-label"] span`).textContent = e.target.value.length + ' von ' + maxLength + ' Zeichen verwendet';
|
||||||
|
|
Loading…
Reference in New Issue