jeremybarbet / react-native-portalize

The simplest way to render anything on top of the rest.
MIT License
335 stars 22 forks source link

react-native-modalize #5

Closed SmirnovM91 closed 4 years ago

SmirnovM91 commented 4 years ago

I have 2 (react-navigation 5) screens which wrapped by your component

and one component which is

<Portal >
        <Modalize
          modalStyle={[styles.modal]}
          adjustToContentHeight={true}
          FooterComponent={
            <Button
              disabled={this.reject_message.length === 0}
              text="SEND"
              onPress={this.onPress}
              style={styles.btn}
            />
          }
          HeaderComponent={<Text style={styles.menuTitle}>{title}</Text>}
          ref={this.modal}>
          <Input
            name="reject_message"
            onChangeText={this.onChange}
            label={t('ENTER_REASON')}
            type="simple"
            multiline
            numberOfLines={3}
            value={this.reject_message}
          />
        </Modalize>
      </Portal>

The is placed on each screens (List,Details).

  1. open modal on List screen
  2. navigate to Details screen
  3. open modal on Details screen
  4. go back to List screen and try to open modal again, and it is not showing

ezgif com-video-to-gif (2)

edc123 commented 4 years ago

Yeah - I am investigating something similar currently: logging our the ref's for each Modalize, I see that the ref.current is null

jeremybarbet commented 4 years ago

Are you using the latest version: 1.0.4? If so, is it also happening when using the previous version 1.0.3?

edc123 commented 4 years ago

Aha! Yes - can confirm the issue is not reproducible after downgrading to v1.0.3, will use that for now.

More info on my scenario is that I have two screens, each using <Portal> and <Modalize> - but switching between screens once (and for me, I have to minimize the app in Simulator) and triggering Modalize.open() results in the error. We use react-navigation.

Perhaps something to do with putting the app in the background on a device?

jeremybarbet commented 4 years ago

Should be fixed in 1.0.5. Let me know

edc123 commented 4 years ago

looks good after 1.0.5 -- legend! 👍🏼

jeremybarbet commented 4 years ago

@benjaminreid is the legend!

fukemy commented 2 years ago

hi @SmirnovM91 , can u tell me which lib is your segment?