// those listeners are added by customizer-final-v33.js
foo.addEventListener('change', e => display.textContent = foo.value);
foo.addEventListener('input', e => display.textContent = foo.value);
// this is basically your listener
foo.addEventListener('keyup', e => foo.value = foo.value.toUpperCase());
<textarea id="foo"></textarea>
<hr />
<h1 id="display">Type and texarea will update this text.</h1>
Чтобы исправить это, вы идете:
// those listeners are added by customizer-final-v33.js
foo.addEventListener('change', e => display.textContent = foo.value);
foo.addEventListener('input', e => display.textContent = foo.value);
// this is basically a working version your listener
foo.addEventListener('keydown', (e) => {
event.preventDefault();
foo.value = foo.value + String.fromCharCode(e.keyCode).toUpperCase();
foo.dispatchEvent(new CustomEvent('input', { bubbles: true }));
})
<textarea id="foo"></textarea>
<hr />
<h1 id="display">Type and texarea will update this text.</h1>