Closed jode-reflact closed 2 years ago
any news on this?
Sorry, had some personal emergencies. Back now. will look into it this weekend.
Sorry for the delay.
If this is not a bug, how do I prevent such behaviour?
This is not a bug. All commands automatically scrolls into view by default. scrollIntoView
is to explicitly scroll based on the need. The editor uses prosemirror-commands
under to work with commands. so unless natively rewriting all commands, its not possible to fix straightaway.
But, looking into other options to mitigate this issue.
Thank you for the reply. A possible solution might be a passed function that is executed after all commands are done, which could be used to reset the window for example.
That might not look neat. there will be a jump.
Alternatively, there is handleScrollToSelection which could help.
handleScrollToSelection() {
return true
}
but this will block all the scrolls including scrollIntoView
method. looking into a way to differentiate them.
handleScrollToSelection
looks useful, is there any way to override it? Maybe through the editor config?
Not possible, I can add but it will block all scrolls. unless able to differentiate the transaction. that is okay?
Yes that would be okay for my purpose
Will add that by today or tomorrow.
Thanks, works like a charm!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.
What happened?
Im using the following code snippet for enabling an bullet list in my editor
this.editor.commands.toggleBulletList().exec();
Besides not using the scrollIntoView Function the window is still scrolled to the editor after execution. If this is not a bug, how do I prevent such behaviour?
Version
v12.2.2
What browsers are you seeing the problem on?
Chrome
Link to reproduce
No response
Relevant log output
No response
Willing to submit a PR?
No response