Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22199 closed defect (bug) (fixed)

Pasting text containing line breaks results in misplaced cursor

Reported by: chrisrudzki's profile chrisrudzki Owned by:
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: TinyMCE Keywords: needs-patch dev-feedback
Focuses: Cc:

Description

Steps to reproduce

  • Add or edit a post
  • Switch to Visual Editor
  • Paste some text that includes line breaks
  • Notice that the cursor jumps to the beginning of the last line pasted, rather than the end of the line.

Sample text to paste:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas non erat
ac felis cursus ornare. Nunc elementum, magna rhoncus imperdiet ultricies,
nisl nulla tempus dui, at mollis risus orci nec lectus.

Change History (11)

#1 @chrisrudzki
12 years ago

  • Version set to trunk

#2 @obenland
12 years ago

  • Cc azaozz added
  • Keywords needs-patch dev-feedback added

While I'd consider it a minor bug, it seems to be pretty annoying and I just had another user complain about it over at .com.

@azaozz, is there a chance we could look into that for 3.5?

#3 @nacin
12 years ago

Is this a browser-specific thing?

#4 @chrisrudzki
12 years ago

@nacin:

No - I can reproduce it across the latest releases of Firefox, Chrome, and Safari.

As it turns out, I have a tricky time reproducing it by simply copying and directly pasting the "sample text" into the visual editor. You might want to try pasting it into a text editor first.

#5 @obenland
12 years ago

I can only reproduce it consistently in FF 16.0.1

It did occur in Chrome 22 too, though. Odd.

#6 @azaozz
12 years ago

The only way I see to fix this is to insert another paragraph after the pasted text. The caret would go in the new paragraph then. Forcing new paragraphs after each pasted content may be a bit too drastic though.

Will pass that upstream, perhaps another fix would be possible.

#7 @hd-J
12 years ago

  • Cc jeremy@… added

I was able to reproduce the problem:

  • In Chrome/Mac and Safari/Mac
  • With the latest version of Trunk.
  • In the Visual Editor as well as in the DFW.
  • Only after expanding the Text area thanks to the "handle" in the bottom right corner of the editor.

I recorded myself and posted the video here, if that helps:

As you can see, the screen also jumps back to the top of the Visual Editor when I paste in some content.

#8 @nacin
12 years ago

Is this reproducible in WP 3.4?

#9 @azaozz
12 years ago

Replying to hd-J:

Could you confirm if this is happening in the TinyMCE demo: http://www.tinymce.com/tryit/full.php

I couldn't reproduce either problem (caret placement after pasting and scrolling to top) there.

Last edited 12 years ago by azaozz (previous) (diff)

#10 @hd-J
12 years ago

I tested again in WordPress 3.4.2 and in the TinyMCE demo:

  • I wasn't able to reproduce the caret placement issue
  • I could reproduce the pasting and scrolling to top issue

#11 @azaozz
12 years ago

  • Milestone changed from Awaiting Review to 3.5
  • Resolution set to fixed
  • Status changed from new to closed

This should be fixed after the TinyMCE update to 3.5.7. Feel free to reopen if the problem persists.

Note: See TracTickets for help on using tickets.