WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#22851 closed defect (bug) (fixed)

Full size images are not properly inserted in IE9

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

Attachments (1)

22851.diff (655 bytes) - added by koopersmith 8 years ago.

Download all attachments as: .zip

Change History (19)

#1 @ryan
8 years ago

Related #22693

#2 @xibe
8 years ago

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.

#3 @jond3r
8 years ago

  • Cc jond3r@… added

#4 follow-up: @jond3r
8 years 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.

#5 in reply to: ↑ 4 @SergeyBiryukov
8 years 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]

#6 @trepmal
8 years ago

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.

#7 @azaozz
8 years ago

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.

@koopersmith
8 years ago

#8 @koopersmith
8 years ago

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

#9 @azaozz
8 years ago

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.

#10 @trepmal
8 years ago

22851.diff works for me :)

#11 @azaozz
8 years ago

+1 to commit.

#12 @koopersmith
8 years ago

Working in IE8.

#13 @jond3r
8 years ago

IE now works as Chrome :)

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

#14 @azaozz
8 years ago

And in IE7.

#15 @nacin
8 years ago

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

#16 follow-up: @azaozz
8 years 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.

#17 @nacin
8 years ago

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.

#18 in reply to: ↑ 16 @jond3r
8 years 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.