react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

Toast is displayed under the Dialog component

Open mohamedGamalAbuGalala opened this issue 3 years ago • 2 comments

Description

Toast should be displayed above the Dialog component, but it's not even with z-index set

Related to

  • [x] Components
  • [ ] Demo
  • [ ] Docs
  • [ ] Typings

Affected platforms

  • [x] Android
  • [ ] iOS
  • [ ] Web

mohamedGamalAbuGalala avatar Feb 03 '22 14:02 mohamedGamalAbuGalala

Hi @mohamedGamalAbuGalala Can you please share a code snippet and maybe a screenshot/video

Thanks

ethanshar avatar Mar 16 '22 05:03 ethanshar

@mohamedGamalAbuGalala This is not a trivial case since Toast is part of the root screen while the Dialog is a modal that is pushed above the root screen. Dev wise - you can render the Toast inside a transparent modal above the dialog:

<View>
  <Dialog .../>
  <Modal transparent visible={this.state.showToast}>
    <Toast .../>
  </Modal>
</View>

UX wise - you can dismiss the modal right before you show the toast.

Please try it and let me know if it works for you.

lidord-wix avatar Mar 16 '22 08:03 lidord-wix

@lidord-wix your solution should work, I actually remember doing the UX-wise solution.

mohamedGamalAbuGalala avatar Dec 06 '22 13:12 mohamedGamalAbuGalala

Cool, so I'm closing this issue :)

lidord-wix avatar Dec 06 '22 13:12 lidord-wix