Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#22851 closed defect (bug) (fixed)

Full size images are not properly inserted in IE9

Reported by: ryan Owned by: nacin
Priority: normal Milestone: 3.5
Component: Media Version: 3.5
Severity: blocker Keywords: has-patch commit
Cc: jond3r@…

Attachments (1)

22851.diff (655 bytes) - added by koopersmith 5 months ago.

Download all attachments as: .zip

Change History (19)

Related #22693

Here is a test I just made using IE9 (win7):

Just uploaded a full-size picture to 3.5-RC6, and asked to insert it as full-size: the image was inserted using a smaller size.

It seems the insertion uses the last-used size. If I insert the image as a thumbnail, then insert it as full-sized, it keeps the thumbnail size. If I insert as medium-sized, then insert as full-size, it keep the medium-size.

By default, it seems to insert the Large size; then it changes the Full setting to whichever setting was used prior on that post.

  • Cc jond3r@… added

comment:4 follow-up: ↓ 5   jond3r5 months ago

Testing RC6 IE9 Win7:

First had no problem when inserting in the Text tab. Besides images always inserted at the top of the text field (I think I've seen a ticket about this issue earlier).

Then I switched to the Visual tab, inserted some image (hard to see what really happened). Switched back to Text, and now when inserting a full-size image (which also only had a thumbnail) the thumbnail was actually inserted.

So there seems to be a difference between Visual and Text tab. Also when in Visual, images are inserted a the cursor position as it seems.

Might do some more testing with Chrome.

comment:5 in reply to: ↑ 4   SergeyBiryukov5 months ago

Replying to jond3r:

First had no problem when inserting in the Text tab. Besides images always inserted at the top of the text field (I think I've seen a ticket about this issue earlier).

Related: #22638, [22877], [22943]

Fired up IE9 and made these observations:

Inserting an image without changing the size (leaving as the default selection 'full'), it gets inserted as the last size used - thumbnail, medium, even sometimes full-size.

If I toggle the size before inserting (default full, change to thumb, change back to full) and insert, I get the expected result.

Seems that the act of changing the size is what's needed - somehow the unchanged default value isn't being picked up. Confirmed this by temporarily setting the default to 'medium' (in wp-includes/media-template.php) and experienced the same results.

Yes, confirmed the same behavior in IE9: changing the size drop-down sets/resets it to the right size.

Also, when changing the size in IE9 the new size doesn't stick. Example:

  • Open the media modal, select an image, change the size drop-down to something else than the initial value and insert the image.
  • Open the modal again, select another image.

At this point in IE the size drop-down is at the initial value before changing it for the first image. In FF and Chrome it is at the value that was selected for the first image.

  • Keywords has-patch commit added

When the selected property is set on an option element in a select element, IE9 does not unset the selected property of the other option elements in that select element. This leads to the full size appearing selected (as it is the default) when in fact, the value is a different size.

22851.diff​ fixes it here.

Wondering if this has something to do with $setting.find(':selected') in IE as this bit seems to return the initial/default :selected rather than the state after changing it.

22851.diff works for me :)

+1 to commit.

Working in IE8.

IE now works as Chrome :)

Only the slight issue with images being inserted at the top in Text mode in IE.

And in IE7.

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 23163:

Makes sure attachment sizes are correctly deselected in IE. Fixes size selections on insert in IE9. props koopersmith. fixes #22851.

comment:16 follow-up: ↓ 18   azaozz5 months ago

Replying to jond3r:

Only the slight issue with images being inserted at the top in Text mode in IE.

Not a regression, same happens in 3.4 and earlier. Not sure if there is a way to get a "bookmark" of the caret position in a textarea in IE, In TinyMCE we do that.

In 23164:

Makes sure attachment sizes are correctly deselected in IE. Fixes size selections on insert in IE9. props koopersmith. fixes #22851. for the 3.5 branch.

comment:18 in reply to: ↑ 16   jond3r5 months ago

Replying to azaozz:

Only the slight issue with images being inserted at the top in Text mode in IE.

Not a regression, same happens in 3.4 and earlier. Not sure if there is a way to get a "bookmark" of the caret position in a textarea in IE, In TinyMCE we do that.

I've now read up on #22638 and #22446. (Things are sometimes moving so fast in these threads, that if you spend to much time researching, when you come back the ticket may already be patched and closed.)

As you say, one might come up with a way to trick IE to remember the caret position in a plain text area. Probably not a high priority though.

Note: See TracTickets for help on using tickets.