Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker Modal not opening on ios with the new architecture #636

Open
THE-REK opened this issue Nov 7, 2024 · 11 comments
Open

Picker Modal not opening on ios with the new architecture #636

THE-REK opened this issue Nov 7, 2024 · 11 comments

Comments

@THE-REK
Copy link

THE-REK commented Nov 7, 2024

Library version: 9.3.1
React native version: 0.75.4, new architecture enabled

#542
When I do this I can click on the picker, but the modal that opens goes to the top of the screen and is not visible.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

Add screenshots to help explain your problem. If screenshots aren't applicable to this issue, write "n/a".

Additional details

  • Device: Iphone 15
  • OS: [17.4]
  • react-native-picker-select version: [9.3.1]
  • react-native version: [0.75.4]
@THE-REK THE-REK changed the title Picker not opening on ios with the new architecture Picker Modal not opening on ios with the new architecture Nov 7, 2024
@DeepakM02
Copy link

pass the mode. it should work

pickerProps={{
mode: 'dropdown',
}}

@THE-REK
Copy link
Author

THE-REK commented Nov 12, 2024

renderIOS() {
    const { style, modalProps, pickerProps, touchableWrapperProps } = this.props;
    const { animationType, orientation, selectedItem, showPicker } = this.state;

    return (
      <View style={[defaultStyles.viewContainer, style.viewContainer]}>
        <TouchableOpacity
          testID="ios_touchable_wrapper"
          onPress={() => {
            this.togglePicker(true);
          }}
          activeOpacity={1}
          {...touchableWrapperProps}
        >
          {this.renderTextInputOrChildren()}
        </TouchableOpacity>
        <View>
        <Modal
          testID="ios_modal"
          visible={showPicker}
          transparent
          animationType={animationType}
          supportedOrientations={['portrait', 'landscape']}
          onOrientationChange={this.onOrientationChange}
          {...modalProps}
        >
          <TouchableOpacity
            style={[defaultStyles.modalViewTop, style.modalViewTop]}
            testID="ios_modal_top"
            onPress={() => {
              this.togglePicker(true);
            }}
          />
          {this.renderInputAccessoryView()}
          <View
            style={[
              defaultStyles.modalViewBottom,
              this.isDarkTheme() ? defaultStyles.modalViewBottomDark : {},
              { height: orientation === 'portrait' ? 215 : 162 },
              this.isDarkTheme() ? style.modalViewBottomDark : style.modalViewBottom,
            ]}
          >
            <Picker
              testID="ios_picker"
              onValueChange={this.onValueChange}
              selectedValue={selectedItem.value}
              {...pickerProps}
            >
              {this.renderPickerItems()}
            </Picker>
          </View>
        </Modal>
        </View>
      </View>
    );
  }

// Wrapping the Modal with a View resolves the issue.

@tonynnabs
Copy link

tonynnabs commented Nov 15, 2024

Any fix for this issue please? Doesn't work with expo 52 and the new architecture. Use to work for the previous react architecture and expo. Does it have anything to do with the Bridgeless Mode?

<RNPickerSelect onValueChange={onChangeText} value={value} style={pickerSelectStyles} useNativeAndroidPickerStyle={false} items={data} />

@BrandonJFrey
Copy link

I am having the same issue

@Dofamen
Copy link

Dofamen commented Nov 17, 2024

I have the same issue here

@Anassedemnati
Copy link

I am having the same issue

@itseriqq
Copy link

Same issue here.

@itseriqq
Copy link

itseriqq commented Nov 19, 2024

image

Actually, when building my app I got those logs on expo doctor. I didn't try at all updating those packages to the version expo doctor recommended cause right now my app is not launched to iOS yet, I just found the issue cuz I use expo go on my iOS smartphone to test my app, but I'll take a try later on upgrading to those versions, but before I'll check if they're dependent of each other.

@gustavomanolo
Copy link

Meanwhile, until this pull request #542 , you can set the following:
style={{ inputIOSContainer: { pointerEvents: "none" } }}
This worked for me, hope it helps.

@itseriqq
Copy link

Meanwhile, until this pull request #542 , you can set the following: style={{ inputIOSContainer: { pointerEvents: "none" } }} This worked for me, hope it helps.

this worked for me too.
thanks!

@Katznicho
Copy link

I have a similar issue and nothing has worked for me as per now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants