mathiasbynens / jquery-details

World’s first <details>/<summary> polyfill™
https://mths.be/details
GNU General Public License v2.0
121 stars 34 forks source link

Broken in jQuery 1.10.x #16

Open mathiasbynens opened 11 years ago

WebDragon commented 11 years ago

'broken' how? details are important. put up a jsfiddle demonstrating the broken, if you please.

einfallstoll commented 9 years ago

'broken' as in 'not working'. I just tested this against IE9 and jQuery 1.11.x and the details don't show/dismiss its content. Even the demo.html is broken for me in IE9.

I'm not a fan of advertise other repos, but since the author abandoned this 2-3 years ago, there's a working zero-dependency solution: https://github.com/kapitancho/logifill-details

tchalvak commented 9 years ago

That repo also hasn't been updated since 2012...

bcjordan commented 9 years ago

IE9 with jQuery 1.11.0 appears to work in some simple situations, save for it no longer hiding bare child elements.

IE9 Win7 via BrowserStack:

bcjordan commented 9 years ago

Somewhat odd aside, wrapping the <details> tag with a paragraph element results in IE9 only hiding/showing up through the next inner <p> element (CodePen).

image

And if a <p> wrapped summary contains an h1, it doesn't even show the first text nodes.

bcjordan commented 9 years ago

Here we go, .contents(':not("any-old-filter")') in jQuery > 1.9 happens to also filter out all non-wrapped TextNodes, while contents() and children() leave all of them in. That causes the $detailsNotSummaryContents to exclude the nodes that need <span> wrapping to hide properly.

jQ 1.9 (leaves in unwrapped nodes): http://codepen.io/anon/pen/MwQmVb jQ 1.10 (filters out unwrapped nodes): http://codepen.io/anon/pen/YXeVLJ

PR forthcoming

bcjordan commented 9 years ago

Nevermind, looks like https://github.com/mathiasbynens/jquery-details/pull/18 handles that situation properly already. Should be merged in?