Ensure the snippet is hidden when mode changes