Add removeEmptyView event and tests

Took over from #1790. Addressed comments from original PR and rebased onto `minor`.