-
Notifications
You must be signed in to change notification settings - Fork 60
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
Allow setting props to Shadow wrapping View #32
Conversation
Hi, I'm missing the functionality of setting custom properties to the shadow wrapper View, in my case I am looking to set `pointer-events` to `none` to avoid shadow handling touch gestures that should be handled by the view underneath the shadow.
Have you tested it? A similar thing was done in #24, to the parent and content view. |
I have tested it and already am using this PR in my production React Native app. In the PR you mentioned you added |
Yes, I will add the shadowViewProps as it may be useful to other cases, I was just curious about the pointerEvents. Going to add both asap. Thanks! |
Hi @orierel! Just added both in 6.0.0 via d32dc12. As a little tip that you may not know (as you haven't done it in your PR), here is how I did it: <View pointerEvents='none' {...shadowViewProps} style={[{ ...StyleSheet.absoluteFillObject, left: offsetX, top: offsetY }, shadowViewProps?.style]}> This way the user can set the style inside the props. Thanks for your contribution and have a great new year! 😀 |
I don't think that would be the right way because now your allowing users override your style props which are required and shouldn't be "violated" by wrong usage. |
Well, the user can also violate the shadow by inputting other "invalid" view props besides the style. Actually I didn't even listed the shadowViewProps in the README as no one will probably need to use it, only people that read the lib code will try to change it to fix something. I did this way because it allows me to try other styles in debugging etc. The user can violate the lib and even React Native in many ways due to wrong usage. Few days before your PR, I was already testing the shadow view style to remove the Precisely, I commited it 1 day before your PR (ea55a99) in 6.0.0.beta-0 branch, using just shadowViewStyle prop instead of shadowViewProps. As you found out that more advanced users could find a use to setting the view props (like adding the I truly appreciate your participation, but in your 4 line code changes, none were exactly equal to how the code came out to be. It was just easier and faster for me to write it by myself to get what I wanted for the lib. Merging and overwriting the few lines you've done wouldn't make too much sense to get it done. It's always safer in opensource to first open an Issue to avoid wasted work. Some PRs can happen to be merged without an Issue and discussion, but sometimes what happened here will happen. |
Hi,
I'm missing the functionality of setting custom properties to the shadow wrapper View, in my case I am looking to set
pointerEvents
tonone
to avoid shadow handling touch gestures that should be handled by the view underneath the shadow.