Skip to content

[Android] List Block - Incorrect cursor position when splitting list item after space #929

@mchowning

Description

@mchowning

When splitting a list item at a point where the cursor is preceded by one or more spaces, the cursor will be moved "forward" when positioned on the new list item line. The number of characters it is moved forward will be equal to the number of spaces that preceded the cursor when the list item was split.

I believe this is occurring because we do not update the caret position in rich-text when spaces will be trimmed by Aztec.

output

⚠️ I do not have access to an iOS device, so I cannot verify whether this is an issue on iOS (seems unlikely though).

Test Scenarios

Scenario 1

  1. Create new List Block
  2. Enter two words separated by a space ('one two')
  3. Position the cursor at the beginning of the second word ('one |two'), so that there is one space preceding the cursor.
  4. Press Enter
  5. Observe that the cursor is positioned between the 1st and 2nd characters in the new list item ('t|wo'), instead of at the beginning.

Scenario 2

  1. Create new List Block
  2. Type 3 letters, 4 spaces (the second space will create a period), and 3 more letters. ('abc.
    def').
  3. Position the cursor between the second and third space ('abc. | def'), so that there are two spaces preceding the cursor.
  4. Press Enter
  5. Observe that the cursor is positioned between the 2nd and 3rd characters in the new list item ('de|f'), instead of at the beginning.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions