Opened 6 months ago

Closed 6 months ago

#22638 closed defect (bug) (fixed)

Investigate IE8 caret positioning when inserting into the editor

Reported by: nacin Owned by: azaozz
Priority: normal Milestone: 3.5
Component: TinyMCE Version: 3.5
Severity: normal Keywords: commit has-patch
Cc:

Description

We thought we resolved this in #22446, but there was at least one report in the WP.com support forums that inserting into the editor in IE8 resulted in the image ending up at the top of the post.

Attachments (1)

22638.diff (593 bytes) - added by lessbloat 6 months ago.
Should do the trick.

Download all attachments as: .zip

Change History (6)

  • Owner set to azaozz
  • Status changed from new to assigned

Should do the trick.

IE does not keep the caret position when the editor iframe gets blurred (all other browsers do).

If the user clicks on the Add Media button we capture the caret position and later restore it before inserting any content. For previous versions of TinyMCE this code needed to call editor.focus() which doesn't seem needed any more (but doesn't hurt to still have it there).

However if the user clicks outside of the editor and then clicks on the Add Media button, the caret position is lost and anything inserted is put at the top of the content. This is not a regression, it has always been like that for IE.

Tested more in IE7 and editor.focus() helps there. The patch looks good, +1 to commit.

  • Keywords commit has-patch added

Just ran through some tests as well. attachment:22638.diff is helpful, especially in IE7. +1.

Note that we insert content at the correct point in the editor when the user clicks directly on the add media button. If the user clicks out of the editor, and then clicks on the add media button, content will be inserted at the beginning of the editor. This is not a regression.

  • Resolution set to fixed
  • Status changed from assigned to closed

In 22943:

Correctly insert images at caret position in IE8/7.

Props lessbloat
fixes #22638

Note: See TracTickets for help on using tickets.