Skip to content

Commit

Permalink
inputevents: backspace to word boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswilm authored Dec 15, 2022
1 parent b221f8c commit 704ade3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions input-events/input-events-typing.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@
assert_equals(beforeInputEvent.data, inputEvent.data);
}, 'It triggers beforeinput and input events on typing BACK_SPACE with no pre-existing content');

promise_test(async function() {
this.add_cleanup(resetRich);
rich.innerHTML = ' A';
await test_driver.click(rich);
await test_driver.send_keys(rich, "\uE003"); // Back Space
assert_equals(rich.innerHTML, ' ');
assert_equals(inputEventsLog.length, 2);
const [beforeInputEvent, inputEvent] = inputEventsLog;
assert_equals(beforeInputEvent.type, 'beforeinput');
assert_equals(inputEvent.type, 'input');
assert_equals(beforeInputEvent.inputType, inputEvent.inputType);
assert_equals(beforeInputEvent.data, inputEvent.data);
}, 'Beforeinput and input events match when typing BACK_SPACE up to a word boundary');

promise_test(async function() {
this.add_cleanup(resetRich);
rich.focus();
Expand Down

0 comments on commit 704ade3

Please sign in to comment.