This was done a bit arbitrarily before which could easily miss things, end up in the wrong state and not trigger animations correctly. This reverts commit c12e5b2b54 and fixes things in a different way.
c12e5b2b54