Restore correct selection after restoring focus