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

[RN][iOS] Adjust InputAccessoryView width to match device width within Safe Area constraints #43303

Conversation

mauriciomeirelles
Copy link
Contributor

@mauriciomeirelles mauriciomeirelles commented Mar 4, 2024

Summary:

This PR updates the InputAccessoryView component to improve its width handling during device orientation changes for both Fabric and the old renderer. With this update, the component will always occupy the full width of the screen and adjust its size when the device orientation changes.

It also updates the component to stick to the safe area in React Native instead of iOS native. This tweak opens up possibilities for better customizations down the line.

Resolves: #27887

Changelog:

[IOS] [FIXED] - Fix InputAccessoryView width on device orientation change

Test Plan:

fix_inputaccessoryview_width.mov

Difference between horizontal list with horizontal safe area inset in the component or on the content

component constraint content inset
component_contraint.mov
content_inset.mov

@facebook-github-bot
Copy link
Contributor

Hi @mauriciomeirelles!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@analysis-bot
Copy link

analysis-bot commented Mar 4, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,461,555 -16,998
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,834,304 -16,756
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 9066308
Branch: main

@mauriciomeirelles mauriciomeirelles changed the title fix: Fix InputAccessoryView width in both Fabric and non-Fabric fix: [iOS] Fix InputAccessoryView width in both Fabric and non-Fabric Mar 4, 2024
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 4, 2024
@mauriciomeirelles mauriciomeirelles changed the title fix: [iOS] Fix InputAccessoryView width in both Fabric and non-Fabric [iOS] Fix InputAccessoryView width in both Fabric and non-Fabric Mar 4, 2024
@mauriciomeirelles mauriciomeirelles marked this pull request as ready for review March 4, 2024 10:24
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 4, 2024
@kelset kelset added the p: Shopify Partner: Shopify label Mar 26, 2024
@cipolleschi
Copy link
Contributor

Thanks for the contribution @mauriciomeirelles and sorry for the late reply: I have been out for some weeks and I missed this.
I'm finishing up some work on some other areas, but I promise to have a look at it as soon as I can!

@cipolleschi
Copy link
Contributor

Hi @mauriciomeirelles, can you please split the contribution in two parts? One for the Safe Area and one for the width?

I'm a bit reluctant with the change as it might break a lot of internal tests and product, unfortunately... But we can try.
To set expectation, this means that we might not be able to land this.

@mauriciomeirelles
Copy link
Contributor Author

Hi @mauriciomeirelles, can you please split the contribution in two parts? One for the Safe Area and one for the width?

I'm a bit reluctant with the change as it might break a lot of internal tests and product, unfortunately... But we can try.

To set expectation, this means that we might not be able to land this.

Sure!
I am out this week but I can do it next week.

@mauriciomeirelles mauriciomeirelles force-pushed the fix_inputaccessory_width branch 4 times, most recently from 3ef8119 to da29ccb Compare April 29, 2024 10:09
@mauriciomeirelles
Copy link
Contributor Author

Hey @cipolleschi, I've just updated the PR to remove the breaking change!
Let me know what you think.

Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

@mauriciomeirelles thanks for updating the PR.

Left a question. Also, we should update the title as now the PR is more like: [RN][iOS] Ensure InputAccessoryView respect SafeArea.

What do you think?

@mauriciomeirelles mauriciomeirelles changed the title [iOS] Fix InputAccessoryView width in both Fabric and non-Fabric [RN][iOS] Ensure InputAccessoryView respect SafeArea. May 1, 2024
@mauriciomeirelles mauriciomeirelles changed the title [RN][iOS] Ensure InputAccessoryView respect SafeArea. [RN][iOS] Adjust InputAccessoryView width to match device width within Safe Area constraints May 1, 2024
@mauriciomeirelles
Copy link
Contributor Author

hey @cipolleschi, I've updated the PR! Let me know what you think!

@cipolleschi
Copy link
Contributor

Code looks good.
I'll try to import this and see how it works, but we might have internal tests failing here... 🙈

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 11, 2024
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 8597727.

Copy link

This pull request was successfully merged by @mauriciomeirelles in 8597727.

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Shopify Partner: Shopify Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[InputAccessoryView] Does not support device orientation change
5 participants