ilkerkesici / react-native-material-date-picker

Material date picker component on react-native.
20 stars 3 forks source link

Modal not closing properly (Web) #2

Open bezbos opened 2 years ago

bezbos commented 2 years ago

The react-native-material-date-picker\components\Modal.js component has a bug where it doesn't close properly after the modal is dismissed. I have only observed this behaviour on React Native Web. I haven't tested other platforms but they probably have the same issue.

The problem is on this line: https://github.com/ilkerkesici/react-native-material-date-picker/blob/86f2a39ae6b5279485cf5155eaab7f0405c95d9c/components/Modal.js#L53-L56

The if statement needs to also check if the animation is hidden:

if (this.state.menuState === STATES.ANIMATING || this.state.menuState === STATES.HIDDEN) {
      return;
}
bezbos commented 2 years ago

3