Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

After pasting, cursor should move to the end of the pasted content #828

Closed

Description

@koke

Currently, the keyboard is dismissed but the caret remains at the beginning of the paragraph.

The keyboard should stay visible and the cursor should be at the end of the pasted content

Activity

  1. self-assigned this
    on Apr 7, 2019
  2. hypest commented on Apr 9, 2019

    @hypest
    Contributor

    Related PR that may be affecting this issue: #629

  3. mkevins commented on Apr 9, 2019

    @mkevins
    Contributor

    Thanks @hypest !

  4. mkevins commented on Apr 9, 2019

    @mkevins
    Contributor

    There are a few things going on in this issue that I'd like to separately identify.

    1. When multi-line plain text is pasted, the pasted text always begins in its own (new) paragraph block, even when the clipboard contents do not begin with a \n (newline).
    2. The caret position after paste is not at the end of the pasted text.
    3. The caret position after paste is not in the correct block (the wrong block is active / focused).

    Here are some steps to reproduce:

    1. Copy multi-line text to the clipboard (e.g. "Paragraph 1.\n\nParagraph 2.\n").
    2. Place caret at the end of the "Hello World!" block.
    3. Tap the caret handle and paste the content.

    Expected result:

    • "Paragraph 1." is appended to the text in the "Hello World!" paragraph block to read: "Hello World!Paragraph 1."
    • A new paragraph block is created below with the text: "Paragraph 2."
    • The new paragraph block is focused / active
    • The caret is in the new paragraph block, at the end: "Paragraph 2.|" (where '|' == caret).

    Actual result:

    • Text is not appended to "Hello World!" paragraph block.
    • Two new paragraph blocks are created with the text "Paragraph 1." and "Paragraph 2.", respectively.
    • The first of the new paragraph blocks is focused / active (i.e. the "Paragraph 1." block).
    • The caret is at the beginning of the text: "|Paragraph 1.".

    Screencast:

  5. mkevins commented on Apr 10, 2019

    @mkevins
    Contributor

    A simpler case of this issue exists for pasting inline content as well.

    Here are some steps to reproduce:

    1. Copy inline text to the clipboard (e.g. "Hello World!").
    2. Place caret just before the 'W' in the end of the "Hello World!" block: "Hello |World!".
    3. Tap the caret handle and paste the content.

    Expected result:

    • "Hello World!" is inserted at the caret position, so the paragraph block reads: "Hello Hello World!World!".
    • The caret position is after the pasted content: "Hello Hello World!|World!".

    Actual result:

    • "Hello World!" is inserted at the caret position, so the paragraph block reads: "Hello Hello World!World!".
    • The caret position is before the pasted content: "Hello |Hello World!World!".

    Screencast:

  6. changed the title [-][Android] After pasting, cursor should move to the end of the pasted content[/-] [+]After pasting, cursor should move to the end of the pasted content[/+] on Jul 1, 2019
  7. hypest commented on Jul 1, 2019

    @hypest
    Contributor

    Updated the title to reflect that the issue (caret staying at the start of the pasted text) is not platform specific.

  8. mkevins commented on Jul 11, 2019

    @mkevins
    Contributor

    This issue has been resolved, seemingly by a combination of PRs that move selection logic to Gutenberg, and to a "higher level". 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions