bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

[iOS 10] Menu layout is broken when restoring Firefox from background

VERIFIED FIXED

Status

()

Firefox for iOS
General
P1
major
VERIFIED FIXED
2 years ago
2 years ago

People

(Reporter: SimonB, Assigned: farhan)

Tracking

({regression})

unspecified
All
iOS
regression

Firefox Tracking Flags

(fxios-v5.2 unaffected, fxios-v5.3 affected, fxios-v6.0 verified, fxios6.0+)

Details

(Whiteboard: [mobileAS])

Attachments

(2 attachments)

(Reporter)

Description

2 years ago
Created attachment 8793330 [details]
IMG_0050.PNG

Build: 5.3(1) RC
Device: iPad Air 2
iOS: 10.0.1

Steps to reproduce:
1. Launch Firefox in portrait view
2. Open the menu
3. Background Firefox by pressing the home button 
4. Restore Firefox

Actual results;
- The menu layout will be broken and all the icons will overlap 

Expected:
- The menu should be correctly displayed

Note:
- This issue was encountered on iPad Air 2 and iPad mini 4 running iOS 10.

- This issue was not reproduced on 5.2(1) released version.
This is a major UI regression affecting all iPads with iOS 10 and it should be fixed in the 5.3 release - if it's not too late
Not reproducible on my iPhone 6 (iOS 10). Seems tablet specific.
(Assignee)

Updated

2 years ago
Assignee: nobody → fpatel
Priority: -- → P1
Whiteboard: [mobileAS]
(Assignee)

Updated

2 years ago
Priority: P1 → P2
(Assignee)

Comment 3

2 years ago
I looked into this a bit more today. This issue can be fixed by closing the menu and reopening it.

Sadly, I'm having trouble understanding why exactly this is happening. I'm writing my thoughts here for when I want to get back to this. 

A change in the menuViewController's appState when going into the background triggers a layout. That triggers a full reloadData of the Menu which causes "prepareLayout" in the Menu's colletionViewLayout. Turns out the bounds of the collectionView are incorrect (width=0). But the layout continues anyways and fails horribly (see screenshot).

This happens because the constraints for the width aren't set the same way they are for the height. One way of fixing this. Is to fix the width of the popOver. This way the case of the collectionview ever being 0 never happens. 

This all wouldn't be such a big deal if once the app appeared again viewDidAppear was triggered and layout happened again. But it isn't
Thanks for looking into this. This seems related to the iOS 10 bug that was fixed a few weeks back where the menu wasn't correctly laying out at all on iPads [1]. From what I can recall, on iOS 10, the UI

> Turns out the bounds of the collectionView are incorrect (width=0). But the layout continues anyways and fails horribly (see screenshot).

My gut says that the timing of the reloadData which in turn forces the relayout is occurring at an incorrect time in the view lifecycle. For example, if you try laying things out manually without autolayout prior to viewDidLayoutSubviews, you get some undefined frame values.

[1] https://github.com/mozilla-mobile/firefox-ios/pull/2070
tracking-fxios: ? → 6.0+
Priority: P2 → P1
(Assignee)

Comment 5

2 years ago
Created attachment 8798004 [details] [review]
Pull Request
Attachment #8798004 - Flags: review?(sleroux)
Comment on attachment 8798004 [details] [review]
Pull Request

Looks good!
Attachment #8798004 - Flags: review?(sleroux) → review+
(Assignee)

Comment 7

2 years ago
master https://github.com/mozilla-mobile/firefox-ios/commit/d78c4790d57597f0f6354150a11a13be68c4ec6d
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED

Updated

2 years ago
Iteration: --- → 1.6
Verifying as fixed on master acc25e6d9.

The Menu is dismissed when foregrounding Firefox.
Status: RESOLVED → VERIFIED
status-fxios-v6.0: affected → verified
You need to log in before you can comment on or make changes to this bug.