This is the version inside of a shadow dom

This is the same thing, but not inside the shadow dom


Set focus inside of each of them and try hitting Cmd+Left to set focus to the beginning of the line (or Cmd+Shift+Left to select to the beginning of the line).

Expected behavior: focus should move to the left side of the contenteditable element.

Observed behavior: in the version inside the shadow dom, the cursor does not move, and the keypress is handled by the browser – in the case of Cmd+Left, the browser navigates to the previous location in the browser history.

More details in the repro repo readme