-
Notifications
You must be signed in to change notification settings - Fork 58
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
RTL layout fixes #585
RTL layout fixes #585
Conversation
With min-width, the scroll view will scroll when the hide keyboard icon appears.
@@ -8,6 +8,8 @@ const gutenbergSetup = () => { | |||
const apiFetch = require( '@wordpress/api-fetch' ).default; | |||
const wpData = require( '@wordpress/data' ); | |||
|
|||
I18nManager.forceRTL( false ); // Change to `true` to debug RTL layout easily. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should leave this here. But for the moment it could be useful for fast checking RTL layout in both iOS and Android, without the need of AndroidStudio
or Xcode
or changing settings on device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can leave it here. It doesn't hurt, no?
Hey @daniloercoli - Can I bug you with a review? |
It seems that |
Tested this PR on both iOS and Android, and it seems to work fine. LGTM once gb conflicts are resolved. Note related to this PR, but i've noticed that the Image Settings BottomSheet is not dismissed when I tap back button on Android. I need to tap outside the sheet to dismiss it. (Tested on Android 6 - Nexus 5). |
Thank you @daniloercoli for the review!
Good catch! If I recall correctly, @marecar3 also noticed it and was working on a fix. I'm not really sure if that's the case. If it's not, I can check that out. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you! |
Fixes #380
This PR fixes two issues related to RTL layout.
1. The block Toolbar on Android:
The content of the scroll view on Android was aligned left, while on iOS it was correctly aligned right. Probably the issue has little to do with alignment itself but on how each platform rotate scroll view for RTL support.
This was fix by forcing the content to grow as big as the scroll view itself (allowing it to grow bigger if necessary).
2. BottomSheet text input:
Fixed in the
gutenberg
related PR (WordPress/gutenberg#13815)This was an issue since we are inverting the natural alignment for text inputs, so we had to express this intention on RTL layout too. Sadly
text-align: end
didn't work (it's not allowed).I added a helper to test RTL layout, but I'm unsure if we should keep for continue testing RTL in the future. Ideally we would have a switch in the UI or use the RN Dev Menu, but this last option requires native development.
To test:
src/index.js
and switchI18nManager.forceRTL(false);
totrue
.