onmotion / react-native-autocomplete-dropdown

Dropdown Item picker with search and autocomplete (typeahead) functionality for react native
MIT License
190 stars 75 forks source link

Issue wrapping with scrollview #36

Open vituallajuphet opened 2 years ago

vituallajuphet commented 2 years ago

I tried to wrap the autocomplete to scrollview but i got this error.

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead

onmotion commented 2 years ago

Hi! Yes, it's because it using FlatList component for rendering dropdown items. It's strange that you can see a warn because it disabled inside the lib: https://github.com/onmotion/react-native-autocomplete-dropdown/blob/c8406cfa22929beb60445b9856a7710f7a2c84b2/src/index.js#L48

Anyway, if you don't want to use FlatList try to consider lib version below 2.0.0

checklist commented 2 years ago

Hi! Yes, it's because it using FlatList component for rendering dropdown items. It's strange that you can see a warn because it disabled inside the lib:

https://github.com/onmotion/react-native-autocomplete-dropdown/blob/c8406cfa22929beb60445b9856a7710f7a2c84b2/src/index.js#L48

Anyway, if you don't want to use FlatList try to consider lib version below 2.0.0

Surely it can't be a solution to use an older version?!

In any case, a definite thanks for the library!

vituallajuphet commented 2 years ago

Thanks we already solved this issue :)

onmotion commented 2 years ago

Thanks we already solved this issue :)

Hi! Please drop your solution here if you can 🙂

dantecarlo commented 2 years ago

Thanks we already solved this issue :)

How?

rameshep1989 commented 1 year ago

Thanks we already solved this issue :)

How did you solve it? i also have same issue and unable to fix it.

onlyhope commented 1 year ago

Thanks we already solved this issue :)

Viva Las Vegas how?

BossBele commented 1 year ago

Look at example (uses scrollview): https://github.com/onmotion/react-native-autocomplete-dropdown/tree/main/example

https://github.com/onmotion/react-native-autocomplete-dropdown/issues/62#issuecomment-1520048916

AbdurRobTanvir commented 9 months ago

hi @onmotion, is this issue solved yet?

If you want to disable a warning, you could apply such workaround

import { LogBox } from 'react-native'

if (__DEV__) {
  const ignoreWarns = [
    'VirtualizedLists should never be nested'
    'Non-serializable values were found in the navigation state.',
    "The action 'POP_TO_TOP'",
    /Could not find image.*data:image/, // met on iOS if load .svg that contains href base64 (footer game providers)
  ]

  const warn = console.warn
  console.warn = (...arg) => {
    for (const warning of ignoreWarns) {
      if (warning instanceof RegExp) {
        if (warning.test(arg[0])) {
          return
        }
      } else if (arg[0].startsWith(warning)) {
        return
      }
    }
    warn(...arg)
  }

  LogBox.ignoreLogs(ignoreWarns)
}