#11520 closed enhancement (wontfix)
show/hide set 'display' to 'inline' in IE8--regardless of Shiv/Shim/Modernizr usage
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Bug exists in IE <= 8. I've only tested in IE8 so far--of the affected browsers. I used the Microsoft provided IE8 testing VM (Windows 7) running inside VirtualBox on Mac OS 10.6.8.
When using jQuery 1.7.2 with Modernizr 2.5 (or other shim/shiv options), using show/hide on an 'article' (or other HTML5 tag) the 'display' CSS property is set to 'inline' rather than 'block'--which is the shived value.
This can be tested/demonstrated with this jsFiddle: http://jsfiddle.net/dC2tT/4/
The "Show the Article" button will '.show()' the 'article' tag. In non-IE browsers (and IE > 8) the content will state that 'display' is set to 'block'. In IE <= 8, the output will state that it's set to 'inline'.
Modernizr/html5shiv/html5shim will sets some display defaults, but defaultDisplay (in effects.js) retrieves the 'display' value from what the browser reports when the element is inserted in the DOM--which is the non-shived value.
defaultDisplay will need to check if the page is "modernized" and if so, use the Modernizr/shiv/shim value instead.
Patch en route.
Change History (7)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Posting this follow-up here as someone closed the comments on the Github pull request:
Fair enough. However, changing that approach (using a class to default them to display:none) doesn't fix the issues with .show():
http://jsfiddle.net/BigBlueHat/mLLL5/
Maybe making defaultDisplay override-able in some way could let Modernizr (or similar) tweak what .show() does without having to hack this into jQuery directly.
comment:3 Changed 11 years ago by
Verified. here's a reduced test case: http://jsfiddle.net/mLLL5/2/
Still not sure if it's something we can fix easily.
comment:4 Changed 11 years ago by
Should I still be running this test in a specific browser? eg. IE8?
comment:5 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Nevermind... Mike, you're using the known broken html5shiv. Try this in IE8:
Pull request sent via Github: https://github.com/jquery/jquery/pull/716