- From: Michael Aufreiter <notifications@github.com>
- Date: Mon, 17 Nov 2025 05:25:50 -0800
- To: w3c/editing <editing@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 17 November 2025 13:25:54 UTC
michael created an issue (w3c/editing#493)
Assuming you have this markup:
```html
<div contenteditable="true">Hello world</div>
```
Now select the whole "Hello world" by triple clicking or pressing CTRL+A.
Now watch the onbeforeinput handler, when typing a character or hitting backspace.
```js
function onbeforeinput(event) {
// I'd expect the two logs below to show the same element
// On Chrome/Safari they do, but not in Firefox
console.log(event.getTargetRanges()[0].startContainer); // returns the div
console.log(window.getSelection().anchorNode); // returns the "Hello world" text node
}
```
Repro: https://michael.github.io/web-editing/repros/012.html
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/493
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/editing/issues/493@github.com>
Received on Monday, 17 November 2025 13:25:54 UTC