Correctly toggle the mobile/desktop view (see #6227)