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

Force block inserter to re-render on device rotation #1495

Merged
merged 3 commits into from
Oct 25, 2019

Conversation

etoledom
Copy link
Contributor

This PR uses onLayout and the internal State of inserter menu to force a re-render of the component on device rotation.

gutenberg PR: WordPress/gutenberg#18101

Fixes: #1491

  • Run the example app (iOS and Android).
  • Press (+) to show the block inserter.
  • Check that the layout looks fine.
  • Rotate the device.
  • Check that the layout rearranges.

Note: There's a small jump after the rotation while the layout changes. As a hotfix is probably good enough, but I'd like to check this out later on.

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@etoledom etoledom marked this pull request as ready for review October 25, 2019 08:52
@hypest
Copy link
Contributor

hypest commented Oct 25, 2019

Tested on few of my android devices:

Tests:

  1. Open Inserter in portrait and rotate. Make sure the Inserter still looks OK in landscape. Rotate back to portrait, make sure it still looks OK.
  2. Open Inserter in landscape and rotate. Make sure it looks OK. Rotate back and should still look OK.

Device:

  1. Nexus 5X (Android 7.1.2): all tests OK ✅
  2. Samsung Galaxy S7E Android 8.0.0): all tests OK ✅
  3. Pixel 2 XL (Android 9): all tests OK ✅

Copy link
Contributor

@pinarol pinarol left a comment

Choose a reason for hiding this comment

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

Works great! 🎉 Thanks @etoledom for the PR!
Before this change I was able to reproduce the problem on iPhone 8. With this PR the problem is fixed. BottomSheet refreshes its layout when I rotate the device.

Tested with WordPress-iOS app

@etoledom etoledom merged commit 2abde85 into release/1.15.2 Oct 25, 2019
@etoledom
Copy link
Contributor Author

Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants