Found during work in T377389. Not a big deal since the content is readable and that's the main goal of this code, but might be something we want to fix or at least document.
Steps to replicate the issue (include links if applicable):
- In network tab set connection speed to 3g.
- Visit https://en.m.wikipedia.org/wiki/Talk:Tony_Hawk%27s_Underground
- As soon as the page has rendered switch to offline
- Expand a section
- Try to close it
What happens?:
- The class is added to the section element rather than toggled, so the section stays open.
What should have happened instead?:
The section should collapse again
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):