Reset selection state when dialog closes

Regression due to work in commit 56ed3fb.