Fixes #1093 issue with visibility transitions interrupted by detachment.