How can i click components behind modal when modal is opening in react native - react-native

I want to do this layout:
Currently I do the layout by this way:
menu is belong to the below part and i marginTop: -30 for it to above the image
FlatList is absolute view and have zIndex bigger than Menu. FlatList have dynamic data and each item of FlatList have textInput to search data ( look at this pic )
I have tried 2 ways:
First way:
I used for the list filtered data, it is limited by the Flatlist area so that my filtered list cannot display fully, just 2 rows visible, the rest of filtered data is invisible. I have tried increase the height of the Flatlist and now I can see the filtered list fully but I cannot click the menu button because menu is overived by the Flatlist,
Second way
I use Modal and tried with this library: react-native-modal-dropdown, I can reach my expertation UI but because it use Modal so when Modal is appearing, my textInput in Item is loss focus, so that I cannot continually input to TextInput until I close the Modal.
Do you guys have any solution for it? Thanks in advance

The modal component use the native Modal, you won't be able to interact with elements outside it while it is still visible.
I am not sure to understand why you cannot use View to display the results, but maybe you could try with FlatList ?

Related

React Native CLI - Creating a button in a ScrollView

Hey I'm just starting out with React Native CLI.
I want to have a button which will add an item in the ScrollView. And the new Item should lead to a new Screen when you press it. But I don't have an idea how to make this nor do I know how to google that xD. Does anyone know how I can make this?
I just have a button which leads to another screen when pressing it.
I hope someone can help me :)
First you have to clear few things and make the logic.
1)Either you want to save that item datathen show it in scroll view, make it Pressable and then u can navigate to a different screen.
Or
You just want to show the data in the scroll view. Once you reload, the data is gone. So that's my bro (In my opinion) is of no use.
For the first step .
You need to store the data in a storage and then fetch it in a scroll view,
make it Pressable and navigate to a different screen.
(hint: If you want to make it Pressable then you can fetch the data into a card component and then call that component in a scroll view).
Now grab your keyboard and start searching on it.

Dropdown picker in sectionList react-native

I try to render a dropdown-picker (react-native-dropdownpicker) in a sectionlist but it's impossable to scroll the content of the dropdown. It only shows the first results.
I tried many things with zIndex, view with flex: 1 as parent but im unable to find the solution.
Is it possible to render in a sectionlist or should i be looking for another solution?
sectionlist with dropdown-picker
I think this is what you want.
List Modes
You have 3 options when choosing the list mode.
DEFAULT
FLATLIST
SCROLLVIEW
MODAL
listMode="FLATLIST"
Notes
The FlatList component shouldn't be nested inside ScrollView or you'll come across the VirtualizedLists should never be nested inside plain ScrollViews warning.
If this happens to you and you only have a few items, consider using the SCROLLVIEW mode. Otherwise, you have to use the MODAL mode.
Take a look at this snack:
https://snack.expo.dev/#devsaeedhabibi/dropdown-picker

React Native Flatlist inside ScrollView

I am trying to develop a profile screen which has the persons profile pic, name, etc in the header as well as tabs that determines which data gets displayed in the FlatList below. I want the header component to be scrollable with the FlatList so that the header does not take up screen space while scrolling the FlatList. Also, the header's tabs will change the data that gets render in the list. I have tried two approaches but neither one has worked. Including the header and flatlist inside of a scrollview causes the flatlist to continually call onEndReach until all of the data is returned, but I also read that this is not recommended. The second approach was setting the ListHeaderComponent on the flatlist to the header component, but every time a tab is change the entire screen reloads. I am looking to have the header scrollable as if it were part of the flatlist, and only the flatlist re-render when a tab is pressed. Similar to what Instagram has with their profile screen. Any help with this issue would be much appreciated.

Popup menu hidden behind other items in FlatList

I have a FlatList and each item uses the react-native-popup-menu functionality to show a popup menu when clicked. However, only the top of the menu appears and the rest is hidden behind the following list items. Is there a way to have the menu appear atop the entire FlatList? Thank you.

React Native - make view in FlatList ignore scroll events but accept onPress events

I'm creating a react native app that displays a list of posts in a FlatList. The posts are either text or images. I have 2 requirements that I'm struggling to achieve:
Scrolling: I want the user to be able to scroll the list of posts effortlessly i.e., the posts should ignore scroll events so they get handled by the parent FlatList.
Select/Click: I want the user to be able to select text or click on links in the posts i.e., the posts should handle onPress() events.
If I render the posts as normal Views in a FlatList, text selection and clicking works as expected but scrolling works poorly. This is because the posts sometimes capture the scroll events. The behavior is much worse with posts that include large images. I can fix the scrolling problem by adding pointerEvents="none" to the posts. However, in this case, it will no longer be possible to select text in the posts or click on any links.
Is there a way to achieve smooth scrolling while still being able to select text and click on links in each individual post? I tested this on Android only.
To disable scrolling you can use the prop scrollEnabled={false} , this is considering the Flatlist inherets Scrollview props as is explained in the react docs.
To make clickable a text, use some touchable, TouchableHighlight, TouchableOpacity, TouchableNativeFeedback.