Fix regression with modal dismissing prematurely.