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: changing orientation attachment picker issues #2687

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

isekovanic
Copy link
Contributor

🎯 Goal

Solves this GH issue. Details of the reproduction steps can be found in the issue itself.

🛠 Implementation details

Here is a brief summary of why this issue is happening:

  • Looking at the containerHeight property in the library as well as looking at the implementation for a bit, we can clearly see that:
    • This value is not meant to be used as a dynamic one
    • It completely prevents recalculation from the library itself and relies on this value solely
  • Typically, whenever we change landscape the value for the top area insets changes (as well as the screen height) and this is passed as a dynamic value to the containerHeight; the BottomSheet is however not shown as it's being controlled entirely by our OverlayProvider
  • Whenever we come back from background mode of the app however, we have a refresh in values that happens "late", and the initial value passed to containerHeight is wrong; only to be updated soon after
  • This however causes the wrong value to be used within the library itself (instead of calculations) and the new value is not respected at all (nor should it, considering that it skips extra rerenders due to calculations) and we end up in a weird state where the BottomSheet is displayed without any of its actual functionalities

The issue is reproducible on virtually any screen by the way, since the OverlayProvider is basically the root of our DOM tree.

🎨 UI Changes

iOS
Before After
Android
Before After

🧪 Testing

☑️ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@Stream-SDK-Bot
Copy link
Contributor

SDK Size

title develop branch diff status
js_bundle_size 442.099609375 KB 442 KB 0 B 🟢

@khushal87 khushal87 merged commit b6dfbb9 into develop Sep 25, 2024
7 checks passed
@khushal87 khushal87 deleted the fix/attachment-picker-issue branch September 25, 2024 09:43
@github-actions github-actions bot mentioned this pull request Sep 25, 2024
6 tasks
@stream-ci-bot
Copy link
Contributor

🎉 This PR is included in version 5.38.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants