Other component is scrolled when the editor is in fixed position

Hi. I have encountered a weird bug that occurs as follows:

I created a component with a position: fixed property and added a ProseMirror editor inside it. However, when I attempt to edit the editor, the first parent component with a relative position gets scrolled down.

The strangest part is that this issue only occurs when I try to edit something on the last line in the editor. In other words, if I type something on the lines above, it doesn’t happen.

Furthermore, the term ‘editing’ encompasses not only typing or deleting letters but also moving the cursor or selecting text.

I found a similar issue in here, but I couldn’t find a solution. I’m also wondering if it’s an issue that has already been resolved.

Could you help me figure out why this happens?

Please let me know if you need any further assistance or clarification.

1 Like

I did not manage to reproduce this. Can you set up a minimal example?

Oh, okay I will make an example soon

I have created a very simple example to illustrate how it works.

If you type anything in the editor located below, you will notice that the upper element filled with '1’s is scrolled down.

Additionally, I have found that it depends on the position of the editor relative to the wrap element.

If the editor is positioned at the bottom of the wrap element, the scroll goes down.

If the editor is positioned at the top of the wrap element, the scroll goes up.

If the editor is positioned inside the wrap element, the scroll remains unchanged.

Please let me know if you have any further questions or need additional assistance!

Thanks, that made it easy to reproduce. This patch should help.

Oh, thank you for the quick response! Can I know when it will be released?

Oh, and I applied your patch to my code and discovered that the problem has been resolved.

I genuinely appreciate your help! Thank you!

I’ve tagged a prosemirror-view 1.31.6

2 Likes

Thank you very much! I really appreciate it. I’m a big fan of prosemirror and I’m very grateful that you have made this wonderful library.

1 Like