lawnstarter / react-native-picker-select

🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
https://npmjs.com/package/react-native-picker-select
MIT License
1.77k stars 500 forks source link

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

Open THE-REK opened 3 weeks ago

THE-REK commented 3 weeks ago

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

https://github.com/lawnstarter/react-native-picker-select/pull/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

DeepakM02 commented 2 weeks ago

pass the mode. it should work

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

THE-REK commented 2 weeks ago
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 commented 2 weeks ago

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 commented 2 weeks ago

I am having the same issue

Dofamen commented 2 weeks ago

I have the same issue here

Anassedemnati commented 2 weeks ago

I am having the same issue

itseriqq commented 1 week ago

Same issue here.

itseriqq commented 1 week ago

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 commented 1 week ago

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

itseriqq commented 1 week ago

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 commented 4 days ago

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