Safari startContainer error from domSelectionRange() method

In our implementation of a rich text editor, we’ve noticed an error (in Safari only) when the editor receives focus.

It’s from the ProseMirror domSelectionRange() method, where it creates a beforeinput event listener then executes an “indent” command. It seems that in Safari, the listener doesn’t fire before it’s removed. So when the code tries to read e.startContainer, e is undefined.

Has anyone else run into this? Is there a fix?

Could you see if prosemirror-view 1.33.4 still has this issue?

I encountered the same issue with safariShadowSelectionRange(), and upgrading prosemirror-view to 1.33.4 resolved it!