react-native-popup-menu icon indicating copy to clipboard operation
react-native-popup-menu copied to clipboard

Incorrect position when using in FlashList

Open tmiyasa opened this issue 2 years ago • 7 comments

When using FlashList, major library for high performance list, and using Menu in reneder() function, the popup displays at incorrect position (display near the first item of the list). https://docs.expo.dev/versions/latest/sdk/flash-list/

It can be reproduced just by replacing FlatList by FlashList in the exmaple. https://github.com/instea/react-native-popup-menu/blob/master/examples/InFlatListExample.js

    return (
      <MenuProvider style={styles.container}>
        <FlashList
          data={data}
          renderItem={({ item }) => (
            <Menu onSelect={(value) => Alert.alert(value)}>
              <MenuTrigger text={"Select option " + item.value} />
              <MenuOptions>
                <MenuOption value="A" text="A" />
                <MenuOption value="B" text="B" />
                <MenuOption value="C" text="C" />
              </MenuOptions>
            </Menu>
          )}
          style={{ height: 200 }}
        />
      </MenuProvider>

When clicking item 30, popup appears at the top. image

FlashList is one of the major RN library for list, so I'd appreciate if you could handle this.

tmiyasa avatar Dec 06 '23 10:12 tmiyasa

I'm also facing this issue. Menu appears at the bottom of the Flatlist container in my app.

AmanSafeer avatar Feb 02 '24 07:02 AmanSafeer

Same here as of April 2024.

PopBot avatar Apr 08 '24 02:04 PopBot

I am getting better luck when using renderers.Popover: image

Ex: import {..., renderers} from 'react-native-popup-menu'. <Menu renderer={renderers.Popover} ...

PopBot avatar Apr 08 '24 03:04 PopBot

I'm also have same issue. Is there any solution for this?

muratcanyusufoglu avatar May 21 '24 07:05 muratcanyusufoglu

I found a partial solution to the issue. When MenuProvider is placed outside the FlashList, it tends to cover the entire screen. However, when MenuProvider is used inside the renderItem function, it only covers the size of the respective item. This change resolves the problem for my situation.

muratcanyusufoglu avatar May 21 '24 08:05 muratcanyusufoglu

Seems like this library is abandoned. Last change was 2 years ago.

noon-ravi avatar Jun 19 '24 18:06 noon-ravi

Did any one find the solution?

AmanSafeer avatar Jun 21 '24 16:06 AmanSafeer