Fix issues with the toolbar not hiding in certain conditions, even if the selection was lost.