Move CSS transition to fix React issue in latest Safari