mmazzarolo / react-native-dialog

Pure JavaScript React-Native dialog
MIT License
681 stars 111 forks source link

feat: Handle Hardware Back Button on Android #114

Closed carissacks closed 3 years ago

carissacks commented 3 years ago

Overview

  1. Add onRequestClose on container component, as mentioned here
    • Purpose: To handle hardware back button event on Android
    • Resolves #111
  2. Fixes prettier error in Modal

Test Plan

  1. Try adding onRequestClose props on Dialog.Container.
  2. Run the app on Android
  3. Show the dialog
  4. Press hardware back button
  5. Check whether the function gets called

GIF:

Code:

      <Dialog.Container
        visible={visible}
        statusBarTranslucent
        onRequestClose={() => {
          setVisible(false);
        }}
      >
      ...
      </Dialog.Container>
mmazzarolo commented 3 years ago

Looking good @carissacks , may I also ask you to update the README to add the description of the prop? Thanks

carissacks commented 3 years ago

Looking good @carissacks , may I also ask you to update the README to add the description of the prop? Thanks

Sure! It's done 🙆‍♀️ Please check whether it's good to go

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 8.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: