react-native-autocomplete-dropdown icon indicating copy to clipboard operation
react-native-autocomplete-dropdown copied to clipboard

Issue wrapping with scrollview

Open vituallajuphet opened this issue 2 years ago • 9 comments

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

vituallajuphet avatar Jun 16 '22 08:06 vituallajuphet

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

onmotion avatar Jun 16 '22 10:06 onmotion

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!

checklist avatar Jul 22 '22 06:07 checklist

Thanks we already solved this issue :)

vituallajuphet avatar Aug 02 '22 05:08 vituallajuphet

Thanks we already solved this issue :)

Hi! Please drop your solution here if you can 🙂

onmotion avatar Aug 02 '22 05:08 onmotion

Thanks we already solved this issue :)

How?

dantecarlo avatar Aug 05 '22 20:08 dantecarlo

Thanks we already solved this issue :)

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

rameshep1989 avatar Oct 24 '22 09:10 rameshep1989

Thanks we already solved this issue :)

Viva Las Vegas how?

onlyhope avatar Oct 31 '22 01:10 onlyhope

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

BossBele avatar Apr 24 '23 12:04 BossBele

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)
}

AbdurRobTanvir avatar Nov 26 '23 09:11 AbdurRobTanvir