Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#22638 closed defect (bug) (fixed)

Investigate IE8 caret positioning when inserting into the editor

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


We thought we resolved this in #22446, but there was at least one report in the 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 11 years ago.
Should do the trick.

Download all attachments as: .zip

Change History (6)

#1 @nacin
11 years ago

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

11 years ago

Should do the trick.

#2 @azaozz
11 years ago

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.

#3 @azaozz
11 years ago

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

#4 @koopersmith
11 years ago

  • 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.

#5 @ryan
11 years ago

  • 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.