toast-ui.vue-editor icon indicating copy to clipboard operation
toast-ui.vue-editor copied to clipboard

Disabling cursorToEnd?

Open Gnopps opened this issue 6 years ago • 3 comments

Version

1.1.1

Test Environment

Firefox, Win10

Current Behavior

When I have markdown enabled as default in the editor then the window will automatically scroll to show the editor (if it needs to be scrolled to, to be seen). If I have WYSIWYG enabled as default then the window will not scroll to the editor.

My guess would be that cursorToEnd is true by default. How can I disable this?

Expected Behavior

I'd like the window not to scroll to the editor's position unless I ask it to.

Gnopps avatar Jul 19 '19 22:07 Gnopps

I did not really understand your issue. Does scrolling automatically scroll to where the editor is? Or does the editor have an initial content and scroll to the end of the content?

sohee-lee7 avatar Jul 22 '19 03:07 sohee-lee7

Does scrolling automatically scroll to where the editor is?

Yes, it seems that the page automatically shows the editor when you have markdown enabled. It does not focus on the editor, just shows it.

Or does the editor have an initial content and scroll to the end of the content?

Yes here as well. The editor does have initial content and when shown in markdown-mode problem occurs. The problem does not occur in WYSIWYG-mode.

Gnopps avatar Jul 22 '19 11:07 Gnopps

We do have the same issue when using the editor with a v-model. When the value of the editor is changed from the outside (e.g. when the database query is finished) the watcher for value triggers setValue() of the JS component with cursorToEnd = true. This causes the JS component to set the cursor which also scrolls down the page if the editor is not within the viewport.

Would it make sense to just pass cursorToEnd = false as default? That fixes it for me locally.

espresso-woozy avatar Aug 14 '19 12:08 espresso-woozy