Fixes view state bug with hiding a view while in ATTACHED_HIDDEN_BY_PARENT

See #1058 for full discussion (with myself). I'm unsure if there are other consequences to this change, but I didn't see any on initial scan.