mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Allow keyboard input to alter email inputs
Previously, the`HTMLInputElement.selectinStart` and `HTMLInputElement.selectionEnd` IDL setters, and the `setRangeText()` IDL method were used when updating an input's value on keyboard input. These methods can't be used for this purpose, since selection doesn't apply to email type inputs. Therefore, this change introduces internal-use only methods that don't check whether selection applies to the given input.
This commit is contained in:
committed by
Andreas Kling
parent
79da6d48c1
commit
db24440403
Notes:
github-actions[bot]
2024-12-30 10:05:12 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/db244404033 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3065 Reviewed-by: https://github.com/Gingeh ✅
23
Tests/LibWeb/Text/input/HTMLInputElement-edit-value.html
Normal file
23
Tests/LibWeb/Text/input/HTMLInputElement-edit-value.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const inputTypes = [
|
||||
"text",
|
||||
"search",
|
||||
"tel",
|
||||
"url",
|
||||
"email",
|
||||
"password",
|
||||
];
|
||||
|
||||
inputTypes.forEach(type => {
|
||||
const input = document.createElement("input");
|
||||
input.type = type;
|
||||
document.body.appendChild(input);
|
||||
internals.sendText(input, "PASS");
|
||||
println(`input[type=${type}] value: ${input.value}`);
|
||||
input.remove();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user