We also needed this when rerendering on append, so moving it into _maybe_rerender allows the two places to share the code. (imported from commit 027d99cae7864747cf1ec94c95e8ece495b5c907)