maintain folder expanded state when last child is deleted
simplify state validation for directories
Merge pull request #6495 from adobe/jasonsanjose/issue-6483

Maintain folder expanded state when last child is deleted