GeekyAnts / NativeBase

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.
https://nativebase.io/
MIT License
20.19k stars 2.39k forks source link

"VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead." while tap item picker #3433

Open patricktan98 opened 3 years ago

patricktan98 commented 3 years ago

I have gone through these following points

Issue Description

node, npm, react-native, react and native-base version, expo version if used, xcode version

Expected behaviour

The Item picker should view without warnings.

Actual behaviour

When Item Picker is shown, the 'VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.' warning shown.

Steps to reproduce

<Item picker>
                        <Picker
                            mode="dropdown"
                            iosIcon={<Icon name="arrow-down" />}
                            style={{ width: undefined }}
                            placeholder="All"
                            Header="Transaction Type"
                            iosHeader="Transaction Type"
                            placeholderStyle={{ color: "#bfc6ea" }}
                            placeholderIconColor="#007aff"
                            selectedValue={this.state.selected2}
                            onValueChange={this.onValueChange2.bind(this)}
                        >
                            <Picker.Item label="Payment" value="Payment" />
                            <Picker.Item label="Top up" value="Topup" />
                            <Picker.Item label="Refunded" value="Refunded" />
                        </Picker>
                    </Item>

Video Link: https://user-images.githubusercontent.com/50147719/106872277-14bbff00-670e-11eb-9497-4407ca5ac2cb.mov

Is the bug present in both iOS and Android or in any one of them?

The bugs occur in iOS and Android. I have tested in iOS 14.4 and Android 11.0

Any other additional info which would help us debug the issue quicker.

Important

If you want your issue to be looked at quicker, attach a snack reproducible with your issue. Makes it easier for us!

dlenskyi commented 3 years ago

Same here I will provide you more details from Element inspector So basically thats because Picker component renders FlatList inside VirtualizedList (screenshot below)

Снимок экрана 2021-02-09 в 18 29 30 Снимок экрана 2021-02-09 в 18 29 49
dlenskyi commented 3 years ago

Same issue here #3334

KasTasElis commented 3 years ago

Same issue for me, still waiting for solutions?

gregormelhorn commented 3 years ago

Please fix this and accept the pull from dlferro!

megacherry commented 3 years ago

yes, please accept the pull to resolve this issue.

hoekma commented 2 years ago

@Ajamuar I am also still having this problem in NativeBase v2 with the sample code. I realize you all are focused on v3 right now, but I hope you will continue to support v2 for a while until we get a chance to rewrite our app.

 <Container>
      <Header />
      <Content>
        <Form>
          <Item>
            <Input value="test" onChangeText={() => true} />
          </Item>
          <Item picker>
            <Picker
              mode="dropdown"
              iosIcon={<Icon name="arrow-down" />}
              style={{ width: undefined }}
              placeholder="Select your SIM"
              placeholderStyle={{ color: '#bfc6ea' }}
              placeholderIconColor="#007aff"
              selectedValue={selected2}
              onValueChange={() => true}
            >
              <Picker.Item label="Wallet" value="key0" />
              <Picker.Item label="ATM Card" value="key1" />
              <Picker.Item label="Debit Card" value="key2" />
              <Picker.Item label="Credit Card" value="key3" />
              <Picker.Item label="Net Banking" value="key4" />
            </Picker>
          </Item>
        </Form>
      </Content>
    </Container>
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

moseslucas commented 2 years ago

I hope the team at native base continue support for nativebase v2 and fix this issue. There are still many apps out there that uses v2

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kleydon commented 1 year ago

It isn't stale, its still an issue.

jmgarciasanti commented 1 year ago

Yes, still an issue. It's thrown as error on iOS devices after migrating app to Expo SDK 48. The error is shown in every screen I have with a Form including a "Select" Native Base component. The error is not thrown on Android.