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

Action sheet always forces portrait mode #11

Open
justkd opened this issue Sep 1, 2021 · 4 comments
Open

Action sheet always forces portrait mode #11

justkd opened this issue Sep 1, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@justkd
Copy link

justkd commented Sep 1, 2021

Bug

When in landscape orientation, when ActionSheetCustom is opened, it forces portrait mode while the action sheet is open. Once closed, it reverts to the original orientation.

Environment info

Library Version
@alessiocancian/react-native-actionsheet 3.0.3
react-native 0.64.2

Steps To Reproduce

  1. Implement ActionSheetCustom on a landscape oriented view.
  2. Open the action sheet in landscape orientation.

Untitled

Describe what you expected to happen:

  1. I expect the action sheet to display in landscape view.
@justkd justkd added the bug Something isn't working label Sep 1, 2021
@alessiocancian
Copy link
Owner

Ok that's odd. 😳

I reproduced the issue and I fixed the orientation by adding supportedOrientations={["portrait", "landscape"]} to the Modal.
Unluckily that's not enough to add landscape support, but I will look into it tomorrow.

@alessiocancian
Copy link
Owner

alessiocancian commented Sep 2, 2021

Released to v3.1.0, let me know if it works for you

EDIT: I saw the native actionsheet on iOS takes less than half of the screen size on landscape mode, should I do the same?

@justkd
Copy link
Author

justkd commented Sep 2, 2021

@alessiocancian I had to go in and add the other landscape orientations in order for this to work, but otherwise it's looking great!

supportedOrientations={["portrait", "landscape", "landscape-left", "landscape-right"]}

Do you know if Android trims it down in the default version? Personally, I do like the trimmed down version for landscape. When it's full width it's a lot of whitespace in most cases.

@alessiocancian
Copy link
Owner

@alessiocancian I had to go in and add the other landscape orientations in order for this to work, but otherwise it's looking great!

supportedOrientations={["portrait", "landscape", "landscape-left", "landscape-right"]}

Ok I'll make this the default value and add an optional prop to change supportedOrientations if needed.

Do you know if Android trims it down in the default version? Personally, I do like the trimmed down version for landscape. When it's full width it's a lot of whitespace in most cases.

There isn't a real equivalent of ActionSheet for Android, there is a material version here but I don't like it.
I think I will implement the "trimmed" version only for iOS style ActionSheets, so on Android only if theme="ios".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants