ammarahm-ed / react-native-actions-sheet

A Cross Platform(Android, iOS & Web) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
https://rnas.vercel.app
MIT License
1.49k stars 121 forks source link

Applying width to `containerStyle` applies to both container and contents #295

Open bradjones1 opened 1 year ago

bradjones1 commented 1 year ago

Thanks for this awesome library. I particularly love that it works both on native and web.

I am working on my web UI and would like to constrain the maximum width of the action sheet. E.g., I only want it to be a maximum of 500px wide, so the contents don't spread across the whole width of the window.

I attempted to apply a width or max-width style value to the containerStyle prop, however it applied to both the action sheet as well as the contents. I only want the former.

I think this is because of this line:

https://github.com/ammarahm-ed/react-native-actions-sheet/blob/93cf9fc943cf9e30cbbb7d4b15a687d1f3fc040c/src/index.tsx#L1131

For the moment I am adding a max-width value to a view inside of the action sheet, but ideally I'd like for it to be the other way around.

bradjones1 commented 1 year ago

I also fully understand maintainers are not working for free and don't expect this to be solved for me, I'm mostly opening this up so I have something to link to in a @todo in my code for when I can loop back around on this.