Skip to content

Dialogs Declared in GutenbergEditorFragment Lost/Dismissed with Screen Rotation #14676

@SiobhyB

Description

@SiobhyB

Expected behavior

I expected dialogs to remain on screen, even when the orientation is changed from portrait to landscape.

Actual behavior

The following dialogs declared in the GutenbergEditorFragment file are lost/dismissed with screen rotation:

This is not only unexpected but can lead to some buggy behaviour, an example of which is given in the below steps to reproduce.

Steps to reproduce the behavior

Steps for showCancelMediaUploadDialog

  • Navigate to the post editor.
  • Add a new image block and choose the option to upload an image directly from your device.
  • Immediately tap on the image block as the upload begins in order to generate the "cancel" dialog.
  • Switch the orientation of the device and observe how the dialog is lost.

Additional buggy behaviour to note from this specific example: The image will appear to be permanently in an "uploading" state and any attempts to tap on it result in the "cancel" dialog appearing again, even though the image has been uploaded to the site's media library.

The "after" from the following screenshot shows the loading indicator overlaying the image, following the above steps, even though the image has actually been uploaded to the site's media library. If I tap on the image in this case, the "cancel" dialog appears again, even though it's not actually possible to prevent the upload.

Before Rotation After Rotation

Steps for Other Dialogs

showCancelMediaCollectionSaveDialog
  • Navigate to the post editor.
  • Add a new story block and choose the option to upload multiple images directly from your device.
  • Immediately tap on the story block as the uploads begin in order to generate the dialog.
  • Switch the orientation of the device and observe how the dialog is lost.
showCancelMediaCollectionUploadDialog
  • Navigate to the post editor.
  • Add a new story block and choose the option to upload multiple images directly from your device.
  • Immediately tap on the story block as the uploads begin. The showCancelMediaCollectionSaveDialog will be the first one to display, but the showCancelMediaCollectionUploadDialog will eventually display some time between the image saving and the uploads completing.
  • Switch the orientation of the device and observe how the dialog is lost.
showRetryMediaCollectionUploadDialog
  • Navigate to the post editor.
  • Add a new story block and choose the option to upload multiple images directly from your device.
  • Immediately enable airplane mode in order to prevent the images from uploading.
  • Return to the story block and top on it to generate the dialog.
  • Switch the orientation of the device and observe how the dialog is lost.
showRetryMediaUploadDialog
  • Navigate to the post editor.
  • Add a new image block and choose the option to upload a new image directly from your device.
  • Immediately enable airplane mode in order to prevent the image from uploading.
  • Return to the image block and tap on it to generate the dialog.
  • Switch the orientation of the device and observe how the dialog is lost.
screenshots for reference
showCancelMediaCollectionSaveDialog showCancelMediaCollectionUploadDialog
showRetryMediaCollectionUploadDialog showRetryMediaUploadDialog
Tested on Pixel 5, Android 11, WPAndroid 17.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions