Page MenuHomePhabricator

Make EditorOverlay usable on Firefox by disabling auto-resizing
Closed, ResolvedPublic3 Estimated Story Points

Description

The code that auto-expands the editor textarea as you type appears to render the editor unusable on Firefox (T214880).
As a temporary fix, let's disable the auto-expand feature in Firefox.

Acceptance criteria

  • Detect the browser is Firefox
  • If Firefox, do not change the height of the textarea

Developer notes

  • Escape the resizeEditor function when the browser is Firefox

https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/src/mobile.editor.overlay/EditorOverlay.js#L354

QA steps

QA Results

StatusDetails
✅ PassedT216547#5008904

Event Timeline

Jdlrobson created this task.
Jdlrobson moved this task from Incoming to Upcoming on the Web-Team-Backlog board.
Jdlrobson added a subscriber: iamjessklein.

I'm not fully sure if adding early escape in _resizeEditor method is the best approach. This method is called in two places:

IMHO it would be better to prevent the latter only, we shouldn't resize on each input event (which causes the editor to jump). Resizing the overlay on setContent() might be required, otherwise, the editor might not match the device size. Please verify that.

Jdlrobson set the point value for this task to 3.Feb 27 2019, 5:06 PM

I've been poking around this issue today, and it seems like exiting early in _resizeEditor leaves the editor in a wonky looking state (half the screen blank where the keyboard would be)
but that does fix the issue.
Removing the input event-binding in postRender however, does not fix the issue, which seems strange to me, because it suggests that event is still firing, but I'm not sure where (on setContent?, I don't see the event in the logs, so I'm not sure if the root cause is really _resizeEditor).

Change 494240 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/MobileFrontend@master] Disabling editor resizing on Firefox

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

Change 494240 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Disabling editor resizing on Firefox

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

@Jdrewniak I pushed a slightly modified version of your patch with Stephen today to make sure the bug fix went out in this week's train. Feel free to improve on that patch at your leisure or call this done. T214880 will remain open :)

Edtadros subscribed.

Test Result

Status: ✅ PASS
OS: macOS Mojave
Browser: Chrome DevTools Device Emulator (iPhone X), Firefox 65.0.1 (64-bit)

Test Artifact(s):
QA steps
Open editor in https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain in Firefox.
Confirm the textarea has scroll

Screen Shot 2019-03-07 at 9.39.46 AM.png (984×475 px, 75 KB)

Open editor in https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain in Chrome
Confirm the editor in textarea takes up full screen

T216547.png (2×1 px, 372 KB)

looks good, resolving