Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
koke opened this issue Apr 5, 2019 · 6 comments
Closed

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

koke opened this issue Apr 5, 2019 · 6 comments
Labels

Comments

@koke
Copy link
Member

koke commented Apr 5, 2019

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

@hypest
Copy link
Contributor

hypest commented Apr 9, 2019

Related PR that may be affecting this issue: #629

@mkevins
Copy link
Contributor

mkevins commented Apr 9, 2019

Thanks @hypest !

@mkevins
Copy link
Contributor

mkevins commented Apr 9, 2019

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:

@mkevins
Copy link
Contributor

mkevins commented Apr 10, 2019

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:

@hypest
Copy link
Contributor

hypest commented Jul 1, 2019

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

@mkevins
Copy link
Contributor

mkevins commented Jul 11, 2019

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

@mkevins mkevins closed this as completed Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants