mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-11-11 18:51:05 +00:00
25 lines
723 B
HTML
25 lines
723 B
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<script src="include.js"></script>
|
|||
|
|
<input id="a" value="foo👩🏼❤️👨🏻bar" />
|
|||
|
|
<input id="b" value="foo👩🏼❤️👨🏻bar" />
|
|||
|
|
<script>
|
|||
|
|
test(() => {
|
|||
|
|
const testDelete = function (id, position, key) {
|
|||
|
|
println(`--- ${id} ---`);
|
|||
|
|
const input = document.querySelector(`input#${id}`);
|
|||
|
|
println(`Before: ${input.value}`);
|
|||
|
|
|
|||
|
|
// Place cursor
|
|||
|
|
input.setSelectionRange(position, position);
|
|||
|
|
|
|||
|
|
// Press backspace
|
|||
|
|
internals.sendKey(input, key);
|
|||
|
|
|
|||
|
|
println(`After: ${input.value}`);
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
testDelete("a", 15, "Backspace");
|
|||
|
|
testDelete("b", 3, "Delete");
|
|||
|
|
});
|
|||
|
|
</script>
|