1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:27:35 +00:00

LibWeb: Update the stored textarea value upon change

And fire the "input" event upon change. This is needed to submit a
comment on GitHub; otherwise, GitHub thinks the textarea value is empty.
This commit is contained in:
Timothy Flynn 2024-03-06 15:14:20 -05:00 committed by Alexander Kalenik
parent 50d3f85f75
commit ed13793110
4 changed files with 39 additions and 0 deletions

View file

@ -2,3 +2,4 @@
2. "PASS"
3. "PASS"
4. 4
5. "PASS"

View file

@ -35,5 +35,19 @@
textarea.innerHTML = 'PASS';
return textarea.textLength;
});
// 5. Textarea input via keyboard events.
testPart(() => {
const textarea = document.createElement('textarea');
// The element currently has to be part of a document to be able to receive keyboard events.
document.body.appendChild(textarea);
internals.sendText(textarea, 'PASS');
const value = textarea.value;
document.body.removeChild(textarea);
return value;
});
});
</script>