Page MenuHomePhabricator

Pressing close (X) in the mobile editor (source or VE) causes the browser to always navigate back, even if that doesn't take you to read mode
Open, Needs TriagePublic

Description

We assume that pressing back will take you to read mode, but if the user has been taken to an edit page directly (such as happens in GrowthExperiments suggested tasks), then pressing back will take you to another page. As pressing close (X) triggers history.back when the hash hasn't been changed manually, this results in the user leaving the page, when they just asked to close the editor.

GE works around this by manually rewriting the history when the editor loads, although this has caused issues (e.g. T377907).

The better approach would be to do what VE desktop does, which is to build the read URL from scratch and write that using history.pushState().