Group view Sort by dropdown state is misleading when filtering by name

Summary

The Sort by dropdown at the group's page shows wrong selected item after typing in the Seach by name field

Steps to reproduce

  1. Navigate to https://gitlab.com/gitlab-org
  2. Set the Subgroups & projects sorting to Last created (or, actually, any non-default sorting)
  3. Start typing a project's name in the Search by name field
  4. The list will be updated according to your Search by name typing and the dropdown will display Name item as selected.
  5. But when you open it, it will be still set to Last created.

Example Project

(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)

(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)

What is the current bug behavior?

The Sort by dropdown shows the last selected item after typing in the Seach by name field

What is the expected correct behavior?

The Sort by dropdown shows Name as the last selected item after typing in the Seach by name field

Relevant logs and/or screenshots

Sep-14-2019_12-45-53-optimized

Output of checks

This bug happens on GitLab.com

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Assignee Loading
Time tracking Loading