alphagov / govuk_elements

❗️GOV.UK Elements is deprecated, and will only receive major bug fixes and security patches.
https://govuk-elements.herokuapp.com/
MIT License
227 stars 90 forks source link

Hard error in details.polyfill.js #502

Closed abbott567 closed 7 years ago

abbott567 commented 7 years ago

If you try to use a <details> tag without markup suggested on govuk-elements, details.polyfill.js throws the following error in the console:

details.polyfill.js:94 Uncaught TypeError: Cannot read property 'id' of null
    at addDetailsPolyfill (details.polyfill.js:94)

As the HTML markup is technically not invalid, I would say that it is incorrect to throw a hard error just because you're using markup that differs to the recommended example. Perhaps a softer warning that you're not using the recommended markup is more appropriate.

gemmaleigh commented 7 years ago

Fixed by #521.