Handle `collapsed` class on triggers even when manually invoked

Fixes #13636.
it would be awesome to define this method the exact same way and include it in all the classes that use this pattern – so at least gzip could be super effective - thoughts?