Multi-panel views: improve keyboard handling

After opening an entity in Multi-panel view, immediately hitting Escape closes the view, which is perfect.

However, if you do some other operation on the entity (e.g. edit a field), then keyboard focus is changed, and Escape no longer closes the view (you must first click somewhere in the view).

This issue of “lost keyboard focus after closing a popup” also exists in other places: e.g., if you open “Edit Fields” from an entity view, immediately hitting Escape will close the Edit Fields popup; but if you first edit a Rule, Escape will not then close the Edit Fields popup (unless it is first clicked).

P.S. Maybe it would be useful to add a topic tag for “keyboard” or “navigation” for the Bugs and Issues category here?

We have some keyboard shortcuts for panels, do you mean that Esc should be replaced to some always working shortcut (since Esc will not work for all cases obviously)

Ideally the user experience is “consistent”, which is not always easy to define.

Escape is a natural way to close a “temporary” popup or panel, and it works as expected in some cases, but not all cases. This is experienced as “inconsistency” in the keyboard handling. Escape does what I expect in the first case, but does not behave the same in the second case, and it is not obvious why.

In this case I think that more-consistent handling of Escape is preferable to having a different dedicated shortcut key to do what we expect of Escape (and what sometimes works).

Similar issue here – after you click in the Comment field, Escape no longer does anything: