refactor(modaldialog): Removes element from dom