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

Do not trigger on summary > a, summary > button #19

Closed mamhoff closed 3 years ago

mamhoff commented 10 years ago

The spec for the summary element states that it can contain links. When clicking on a link though, the details should not be shown if the link is meant to be clicked (as that probably be unintended behaviour). This patch - while not particularly superclean - prevents opening the details box if the element that's been clicked or one of its ancestors is a button or a link.