Page MenuHomePhabricator

Moving focus while link context is visible does not close it
Open, Needs TriagePublic

Assigned To
None
Authored By
Esanders
May 11 2022, 11:38 PM
Referenced Files
F35219029: image.png
Jun 8 2022, 2:29 PM
F35219021: image.png
Jun 8 2022, 2:29 PM
F35132108: image.png
May 11 2022, 11:40 PM

Description

  1. Open reply tool on mobile
  2. Expand the 'Advanced' section
  3. In the reply tool, add a link and focus it so the link context is visible
  4. Focus the "Summary" field

Observe the link context is still visible:

image.png (677×426 px, 33 KB)

Expected:
The link context closes when the summary input is focused.

We use ce.Surface "deactivation" to support the link context on mobile, however by design the surface will not blur in response to any focus change while it is deactivated.

The same issue can be reproduced in other VE integrations:

Article editor (move focus to site search):Flow (move focus to another reply area):
image.png (548×431 px, 41 KB)
image.png (733×513 px, 33 KB)

Event Timeline

T255292 is similar, but the problem here is that we stop listening to blur events completely once the surface is deactivated.

To fix this we would either need to distinguish between focus leaving the document for something still within the editor, e.g. the input of a link inspector in VE desktop, and focus leaving the document for another control (the edit summary input here). Currently no such distinction exists, and if we were to star blurring the document when a deactivated focus went to certain places, we would need to check there weren't any false positives (e.g. focus temporarily landing on <body> in some slightly broken browser, or an input that's part of an inspector, but attached to some part of the DOM we don't consider the editor)

It looks like we have fixed this in the desktop version, but not on mobile.

It looks like we have fixed this in the desktop version, but not on mobile.

I don't think this was ever broken on desktop.