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

Keep toggleOpen() from displaying inline CSS or JS on the page #26

Open mattbrundage opened 5 years ago

tchalvak commented 5 years ago

Makes sense, though perhaps it’s not ideal to put those elements inside details.

pthorson commented 4 years ago

I'm curious about how to repeat this issue.

It appears to me that in IE11, jQuery 1.12 will always flag script and style nodes as display none. (That depends on the result of a call to defaultDisplay("SCRIPT"))

mattbrundage commented 4 years ago

@pthorson , here's a reduced test case: https://codepen.io/mattbrundage/full/gOOarjN Notice that when you show contents, the inline CSS and JS appear in IE and Edge.

@tchalvak while it's not ideal, <script> is a valid direct descendant of the <details> element.

pthorson commented 4 years ago

@mattbrundage Thank you for the test case. I was testing with an older version of jQuery. Looks like they changed behavior for those elements at some point.