-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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(Android, iOS): Fix AnsiHighlight Style in RTL Layout #47230
Conversation
Hi @hexboy! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Hi @hexboy, may I ask when you make the pull request, how did you passed the Run Danger on PR / danger (pull_request_target) check? |
Hi @dnhan1707, |
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.
Great change! Left a couple of questions
packages/react-native/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js
Outdated
Show resolved
Hide resolved
</View> | ||
))} | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
minWidth: '100%', |
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.
Do we still need to force these to be at least 100% now that the direction is forced to be LTR?
An aside, the offsetting here when content length less than container feels like an Android RTL scrollview bug.
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.
#47280 should fix Android bug here
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.
Summary: Noticed in the screenshots of facebook#47230 that Android's logic of setting scroll content origin to zero, than right aligning scroll offset, won't correctly handle case where content is smaller than scrolling container. We can fix that by only resetting the origin when content overflows container, since we otherwise are not scrollable, and scroll adjustment will not translate. Changelog: [Android][Fixed] - Fix RTL ScrollView position when content smaller than container Differential Revision: D65136654
…book#47280) Summary: Noticed in the screenshots of facebook#47230 that Android's logic of setting scroll content origin to zero, then right aligning scroll offset, won't correctly handle case where content is smaller than scrolling container. We can fix that by only resetting the origin when content overflows container, since we otherwise are not scrollable, and scroll adjustment will not translate. Changelog: [Android][Fixed] - Fix RTL ScrollView position when content smaller than container Differential Revision: D65136654
…book#47280) Summary: Noticed in the screenshots of facebook#47230 that Android's logic of setting scroll content origin to zero, then right aligning scroll offset, won't correctly handle case where content is smaller than scrolling container. We can fix that by only resetting the origin when content overflows container, since we otherwise are not scrollable, and scroll adjustment will not translate. Changelog: [Android][Fixed] - Fix RTL ScrollView position when content smaller than container Differential Revision: D65136654
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: Pull Request resolved: #47280 Noticed in the screenshots of #47230 that Android's logic of setting scroll content origin to zero, then right aligning scroll offset, won't correctly handle case where content is smaller than scrolling container. We can fix that by only resetting the origin when content overflows container, since we otherwise are not scrollable, and scroll adjustment will not translate. Changelog: [Android][Fixed] - Fix RTL ScrollView position when content smaller than container Reviewed By: rshest Differential Revision: D65136654 fbshipit-source-id: 2818ff6360cbfac64d7e57bdcbbe8c0a9b4bbb97
@NickGerleman, I updated my PR, and the workflow failed link, but I couldn't see any error. |
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@NickGerleman merged this pull request in 9a3958a. |
This pull request was successfully merged by @hexboy in 9a3958a When will my fix make it into a release? | How to file a pick request? |
Summary:
This pull request fixes a style bug in the AnsiHighlight component when the application is in Right-To-Left (RTL) mode. The adjustments ensure that text highlighting is visually consistent and functions properly across all layout modes.
Before
After
Changelog:
[GENERAL] [Fixed] - AnsiHighlight style in RTL layout
Test Plan:
To test the changes, open LogBox while the app is in RTL mode. The modifications ensure that any error messages display correctly. I have verified that the changes function properly in both LTR and RTL modes, and all existing functionality remains unaffected.
This is an example component to throw an error to show LogBox.