Kheys
2 265
modifications
(→Passage en React : autre endpoint pour ecrire) |
|||
| Ligne 253 : | Ligne 253 : | ||
nativeSetter.call(textarea, value); | nativeSetter.call(textarea, value); | ||
textarea.dispatchEvent(new Event('input', { bubbles: true })); | textarea.dispatchEvent(new Event('input', { bubbles: true })); | ||
} | |||
Option secondaire (plus bas niveau : API DOM) à éviter sauf si la première méthode est bloquée : | |||
function fonctionreact(textarea, value) { | |||
textarea.setRangeText(value, 0, textarea.value.length, "end"); | |||
textarea.dispatchEvent(new Event("input", { bubbles: true })); | |||
} | } | ||