colorfy-software / react-native-modalfy

🥞 Modal citizen of React Native.
https://colorfy-software.gitbook.io/react-native-modalfy
MIT License
1.08k stars 44 forks source link

Unable to override backdropOpacity and backButtonBehavior #15

Closed m-ramp closed 4 years ago

m-ramp commented 4 years ago

Hi, great library, just what I was looking for! From the docs, I read that options could be overridden through:

  1. static modalOptions
  2. modal specific options
  3. defaultOptions

in the same order of priority. However backdropOpacity and backButtonBehavior is always being picked from number 3.

checked the code in ModalStack.js const { stack: { defaultOptions: { backdropOpacity }, }, } = this.props and it is intentionally picked from defaultOptions, is this a bug or is this how it is supposed to work ?

CharlesMangwa commented 4 years ago

Hi @m-ramp! Thanks for the support and the heads up!

You're right about the 2 points you raised - the way Options work and backdropOpacity & backButtonBehavior missing. But that's intentional because as of now, changing these 2 values on the fly (aka per modal pretty much) would lead to some visual discrepancies we didn't tackle yet.

If you want to play with it and maybe submit a pull request, please do!

m-ramp commented 4 years ago

Thanks. Will see what I can do!

CharlesMangwa commented 4 years ago

Hey @m-ramp! Just wanted to let you know that Modalfy v2 just shipped with per modal support for backdropOpacity & backBehavior amongst other pretty nice features! You can check out the blog post over here whenever you'll have a moment: https://colorfy-software.gitbook.io/react-native-modalfy/blog/modalfy-v2!

m-ramp commented 4 years ago

Thats great! will try it out in my next project.