Focus on editor always resolve to last cursor location. (bug)

Is there a way to disable focus from auto restore cursor location to the last known position when editor is regaining focus?

if you have 3 empty blocks and left the cursor on the second line, then click away to lose the focus on the editor. When you try to click on the first line, the editor will automatically move the cursor to the last known position, which is 2nd line.

Is there a way to disable cursor auto restore to last known position? in this case the user was intended to move the cursor to the first line, but the focus automatically moved it to the last known position.

ezgif-2-e62c0f0e7f

I am not seeing this behavior in the website demo on Firefox or Chrome. Can you say a bit more about the setup needed to reproduce it (or, ideally, create a minimal example script, with no React or Vue involved)?

Hi, Thank you so much for the quick response. It is actually happening on the example page. ProseMirror basic example

The key is empty lines, blocks that are empty. if you have multiple lines of empty blocks, and left the cursor at the last line, then blur the editor while clicking away, when you click on the first line after blur you will see the cursor got moved to the last known position. ezgif-1-af3e3fb2ee

I see — it only occurs when you click at the very start of the document. This patch should help.

It is confirmed that the issue is resolved. Thank you so much for fixing this