LibWeb: Partially implement <textarea>'s selectionStart and selectionEnd

This implementation pretends we never have a selection. GitHub relies on
these values to know where to insert text corresponding to file uploads.
This commit is contained in:
Timothy Flynn 2024-03-14 10:05:07 -04:00 committed by Andreas Kling
commit c0d594568d
Notes: sideshowbarker 2024-07-16 22:11:09 +09:00
5 changed files with 84 additions and 2 deletions

View file

@ -0,0 +1,15 @@
<textarea id="textarea"></textarea>
<script src="include.js"></script>
<script type="text/javascript">
test(() => {
let textarea = document.getElementById("textarea");
textarea.focus();
println(`selectionStart: ${textarea.selectionStart}`);
println(`selectionEnd: ${textarea.selectionEnd}`);
textarea.value = "Well hello friends";
println(`selectionStart: ${textarea.selectionStart}`);
println(`selectionEnd: ${textarea.selectionEnd}`);
});
</script>