fix(dialog): transition in and out properly to/from click element

Closes #568.