Opened 11 years ago
Closed 11 years ago
#22638 closed defect (bug) (fixed)
Investigate IE8 caret positioning when inserting into the editor
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | TinyMCE | Keywords: | commit has-patch |
Focuses: | 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)
Change History (6)
#2
@
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
@
11 years ago
Tested more in IE7 and editor.focus() helps there. The patch looks good, +1 to commit.
#4
@
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.
Should do the trick.