draft-js
draft-js copied to clipboard
Editor won't auto-scroll to keep cursor in view when cursor is inside a Decorator Component
Right now, if you are typing in a normal draft-js editor, without any decorators, and your editor is set up to scroll instead of auto-expand, as you type past the end of the visible space in the editor, the cursor will automatically scroll up so the text you are typing is visible.
However, if you are typing and your cursor is inside a Decorator Component, the editor will not auto-scroll to show the cursor.
It's expected that the editor will always scroll to show the cursor when typing, regardless of whether the cursor is inside a decorator component or not.
Here is a fiddle to show the problem: https://jsfiddle.net/axrbyfpp/3/. If you type enough text to cause the box to scroll, the cursor disappears and doesn't cause the editor to auto-scroll. However, if you either remove the decorator, or just change it by commenting out and in the lines specified in the fiddle, then the editor will auto-scroll as expected.
I don't believe this ever worked in Draft, but it's not working using v.0.9.1. Tested using Chrome, Safari and Firefox on Mac OS X 10.11.6
Just tried out this fiddle as I'm researching what appears to be the same issue of the cursor not scrolling and text entry goes off the bottom of the container.
That said your jsfiddle works perfectly with the text staying perfectly in scroll.
Just tried my fiddle again. Using Mac OS X 10.11.6 and Chrome 56.0.2924.87 (64-bit), the problem still occurs (In the following gif I'm typing the entire time):
This is definitely still a problem in 0.10.4.
If I decorate my text, it won't auto-scroll. If I comment out the decorator, works fine.
I notice this issue is still open. Is there any recommended workaround or a plan for improvement?
Not only decorator but adding new line with shift+enter in a scrollable editor with max height will also hide the cursor (until typing some char which is not decorator trigger).
This problem still occurs. Is there any recommended solution or plan to solve this. Please share. TIA
This problem still occurs.
Still an issue