The solution of removing the animation class from the dialog sort of works, but the root of the problem is that you are changing a certain state that is causing the dialog to rerender. The real solution would be to extract the block of code inside of the dialog to a separate component to stop the dialog from rerendering and replaying the opening animation.