RichEditorView icon indicating copy to clipboard operation
RichEditorView copied to clipboard

relativeCaretYPosition returns 0 on new line

Open the-old-one opened this issue 6 years ago • 2 comments

If the cursor is in the middle or at the start of a word, relativeCaretYPosition returns 0 when Return pressed.

As a result, the view does not follow the cursor.

It happens because runJS("RE.getRelativeCaretYPosition();") in this case returns NaN.

To reproduce: Run RichEditorViewSample, select Swift or Objective-C, type any character, move the cursor to the start of the line, press "return" till the cursor disappears below the bottom edge of the view. The view will not scroll.

Expected behaviour: The view scrolls to show the cursor. richeditorview

Tested on iOS 11.

the-old-one avatar Jul 02 '18 05:07 the-old-one

I believe I fixed the issue. Please check the linked commit.

The problem was happening when editing a text node.

the-old-one avatar Jul 03 '18 00:07 the-old-one

Its not solved yet as its easy reproducible if editor's isScrollEnabled is false

paresh-navadiya avatar Apr 10 '19 06:04 paresh-navadiya