Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gallery size labels #1798

Merged
merged 7 commits into from
Feb 3, 2020
Merged

Fix gallery size labels #1798

merged 7 commits into from
Feb 3, 2020

Conversation

mkevins
Copy link
Contributor

@mkevins mkevins commented Jan 22, 2020

Fixes #1792

Related PR

gutenberg: WordPress/gutenberg#19800

Description

This PR fixes the image size option labels in the gallery block settings. The image size options were added for web, but on mobile, the labels were undefined. This resulted in "blank" buttons, and in the beta build for iOS this also resulted in a crash.

How has this been tested?

Tested on Android via WordPress-Android, and iOS via WordPress-iOS:

Steps:

  • Create a gallery block with some images
  • Tap the gallery
  • Tap the gallery settings icon (the gear)
  • Tap "Images size"

Expected result:

  • The app should not crash
  • The image size options should be visible in the menu

Steps:

  • Tap one of the image size options (e.g. thumbnail)

Expected result:

The image resolution should change (to a lower quality with thumbnail, higher quality with large or full).

Screenshots

Types of changes

On mobile, the name property in imageSizes is undefined, but label is already set. So this PR defaults to using the label if it is truthy, and falls back to using the name if not.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@mkevins mkevins changed the base branch from release/1.21.0 to develop January 23, 2020 01:06
@mkevins mkevins marked this pull request as ready for review January 23, 2020 01:19
@mkevins mkevins added the [Type] Enhancement Improves a current area of the editor label Jan 23, 2020
Copy link
Contributor

@chipsnyder chipsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Wordpress iOS and Wordpress Android working as expected

Copy link
Contributor

@geriux geriux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when tapping gallery size options
3 participants