AP.resize() doesn't work on mobile

Description

AP.resize() should work in Jira mobile app just the same as it works on desktop. One common use case is to resize the iframe / web view after a dropdown menu was open / closed. If an open menu is positioned at the bottom of the screen it will be cut. Such placement of a menu is not rare, for example imagine a long list of items, each having a button triggering a contextual menu for selected item.

AP.resize() doesn't work for Jira mobile app for Android. Not sure about iOS and macOS.

Environment

None

Attachments

2
Won't Do

Pawel NiewiadomskiFebruary 4, 2022 at 4:58 PM

Any reason that issue got closed without any comment? AP.resize is needed to make UI work in many cases.

Is there any alternative we can use on mobile? What’s your suggestion we should do in cases where AP.resize was needed?

Maciej OpalaOctober 28, 2020 at 9:58 AM

The screenshots below were taken for our add-on, Issue Checklist.

In a browser, when we call AP.resize() the iframe correctly expands to accommodate open menu:

Unfortunately, it doesn’t work in the Android app and the menu is cut:

Maciej OpalaOctober 27, 2020 at 12:50 PM

I checked that again and unfortunately calling AP.resize() in Jira mobile app for Android (haven't checked other apps) has completely no effect.

There can be applied ac-content class to the root DOM element but we can’t use it because a) it doesn’t make the element shrink back b) it doesn’t work with non-statically positioned elements, which means it doesn’t work for inline dialogs or dropdown menus from Atlaskit. Instead, we rely on mutation observers, few lines of custom code to compute the required height when absolutely positioned elements are visible (like open menu) and, as a final step, an invocation of AP.resize('100%', requiredHeightInPixels).

The thing is that AP.resize() simply doesn’t do anything in the mobile app - the height of the iframe stays exactly the same. So, if user opens a menu that is at the bottom of the screen, s/he won’t see it or will see only some top part of it (depending on its position obviously). ac-content class wouldn’t help either because as I mentioned it doesn’t work for absolutely positioned elements, even if they are inside a node having the class.

I believe this is a major problem because each vendor have to put an additional effort to implement some kind of a workaround (like adding a <div></div> with height set to some pre-computed value after the proper content of the iframe) to simply make it possible for the user to interact with some UI elements build with Atlaskit.

Ideally though it would be best if the custom mechanism I described in the second paragraph wouldn’t be needed and a use of ac-content class would take care of automatically expanding and shrinking the iframe as needed.