WordPress.org

Make WordPress Core

#22199 closed defect (bug) (fixed)

Pasting text containing line breaks results in misplaced cursor

Reported by: 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)

comment:1 chrisrudzki18 months ago

  • Version set to trunk

comment:2 obenland18 months 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?

comment:3 nacin18 months ago

Is this a browser-specific thing?

comment:4 chrisrudzki18 months 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.

comment:5 obenland18 months ago

I can only reproduce it consistently in FF 16.0.1

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

comment:6 azaozz18 months 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.

comment:7 hd-J18 months 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.

comment:8 nacin18 months ago

Is this reproducible in WP 3.4?

comment:9 azaozz18 months 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 18 months ago by azaozz (previous) (diff)

comment:10 hd-J18 months 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

comment:11 azaozz17 months 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.