Page MenuHomePhabricator

When pressing esc key the search field should lose the input focus
Closed, ResolvedPublic

Description

The filter search works in combination with the filter panel. Currently, if the user enters the search field and presses "esc" key, the panel gets closed, but since the text input is still active in the search bar, the user reaches an inconsistent status: the user can keep typing but no selection is possible since the panel is gone and cannot be made appear again (unless the user exits and enters the field again).

Making the "esc" key to remove the input focus from the search field (in addition to closing the panel) would solve the issue.

This is a minor glitch, so feel free to prioritise it accordingly.

Event Timeline

Change 346205 had a related patch set uploaded (by Mooeypoo):
[oojs/ui@master] PopupWidget: Ignore 'escape' key if it is pressed on $autoCloseIgnore

https://gerrit.wikimedia.org/r/346205

Change 346206 had a related patch set uploaded (by Mooeypoo):
[mediawiki/core@master] RCFilters: Don't close the popup when user hits 'escape' in input

https://gerrit.wikimedia.org/r/346206

This is a bit annoying; OOUI listens to document event for keydown and dismisses the popup automatically if "escape" was called - and that happens before we intercept the event as part of the input events itself.
I submitted a proposed fix to OOUI and a dependent one for RCFilters that would fix it.

Change 346205 abandoned by Jforrester:
PopupWidget: Ignore 'escape' key if it is pressed on $autoCloseIgnore

Reason:
Roan says this isn't wanted; please restore if I've misunderstood.

https://gerrit.wikimedia.org/r/346205

Change 346206 abandoned by Mooeypoo:
RCFilters: Don't close the popup when user hits 'escape' in input

Reason:
As was pointed out - this is not the way to do this; abandoning patch, another will follow for the actual solution.

https://gerrit.wikimedia.org/r/346206

Change 356172 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] RCFilters: Blur input on 'escape' key

https://gerrit.wikimedia.org/r/356172

Change 356172 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Blur input on 'escape' key

https://gerrit.wikimedia.org/r/356172

Checked the fix in betalabs.

QA Recommendation: Resolve