nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
17.23k stars 1.76k forks source link

Using the WYSIWYG editor on mobile causes consistent jump to top behaviour #1083

Open j-erasmus opened 4 years ago

j-erasmus commented 4 years ago

Describe the bug

On mobile (Android Firefox) when typing in the WYSIWYG editor it jumps to the top of the editor (See video).

The scroll position is adjusted when the editor gains focus.

To Reproduce

Steps to reproduce the behavior:

  1. Open the SSE on Android in Firefox.
  2. Focus at a section in the editor lower down on the page
  3. The keyboard opens and the editor scrolls to the top

Expected behavior

When typing in the WYSIWYG editor, the cursor should keep its position and the cursor position should not scroll out of view.

Preview

2020_07_08_12_12_40 2020-07-08 12_16_33

Smartphone (please complete the following information):

Additional context

Link for replicating the bug: https://ndu68.csb.app/

No further investigation has been done but I have a hunch that this bug might be caused bu the way ToastUI determines the cursorHeight and editorHeight in the scrollIntoCursor() function when the keyboard is open.

yar2001 commented 3 years ago

Yes! In android, the editor jump to top. While in IOS, the editor fail to show the cursor. Do you have any measure to solve it?