fix #29751
fix regression: delete part/undo
remove spanner if anchor is removed