Issue #21006:set mode to view if closed