Files
ladybird/Tests/LibWeb/Text/input/input-select-on-tab-focus.html
Jelle Raaijmakers b07a576c22 LibWeb: Select contents of <input> when tabbing through fields
Browsers seem to make it convenient to replace an <input>'s contents by
selecting all text on focusing, but only if you used keyboard
navigation. Programmatic focus and clicking on the field do not show
this behavior.
2026-02-11 11:17:27 +01:00

20 lines
476 B
HTML

<!DOCTYPE html>
<input id="a" value="hello" />
<input id="b" value="world" />
<input id="c" />
<script src="include.js"></script>
<script>
test(() => {
a.focus();
a.offsetWidth;
println(`a: ${a.selectionStart} ${a.selectionEnd}`);
internals.sendKey(a, "Tab");
println(`b: ${b.selectionStart} ${b.selectionEnd}`);
internals.sendKey(b, "Tab");
println(`c: ${c.selectionStart} ${c.selectionEnd}`);
});
</script>