Items are not clickable over a MapView (Android)
See original GitHub issueI am using the expo-managed workflow, and I would need to use the dropdown at the top part of a screen view, and below I have a MapView (react-native-maps).
After opening the dropdown, items over the MapView are not clickable.
I tried to write a simple code snippet in order to make it easily replicable:
import React, { useState } from "react";
import { StyleSheet, View } from "react-native";
import DropDownPicker from "react-native-dropdown-picker";
import MapView from "react-native-maps";
export default function App() {
const [open, setOpen] = useState(false);
const [value, setValue] = useState(null);
const [items, setItems] = useState([
{ label: "Apple", value: "apple" },
{ label: "Banana", value: "banana" },
]);
return (
<View style={styles.container}>
<View style={styles.top}>
<DropDownPicker
open={open}
value={value}
items={items}
setOpen={setOpen}
setValue={setValue}
setItems={setItems}
zIndex={1000}
/>
</View>
<MapView style={styles.map}></MapView>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: "column",
backgroundColor: "yellow",
},
top: {
flexDirection: "column",
marginTop: 40,
height: 70,
zIndex: 10,
},
map: {
flex: 1,
zIndex: 0,
},
});
The same code is working perfectly on iOS.
I would appreciate it if you have some suggestions, thank you in advance!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:20 (2 by maintainers)
Top Results From Across the Web
Using a non clickable MapView - android - Stack Overflow
When you set clickable(false) you can't use onClick , when you set clickable(true) then onTouch will take focus. So, override onTouch and then...
Read more >Events | Maps SDK for Android - Google Developers
To disable click events on a map in lite mode, call setClickable() on the view that contains the MapView or MapFragment . This...
Read more >Showing panel on top of map - panel not clickable on android
1.- click on the top panel to show the bottom panel (check that it moves overlaying the bottom bar) · 2.- click on...
Read more >[Solved]-Android MapView in fragment freeze (not clickable or ...
Coding example for the question Android MapView in fragment freeze (not clickable or dragable) after initialisation-Googlemaps.
Read more >Android: MapView.Callout - seems to be clickable with touch ...
Android : MapView. ... On iOS, touchable elements inside a custom callout work fine. ... On Android, the callout layout is not right....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@sibandrew you can check this package as well, at least it solved my issues which is similar to yours. I tried few but this one looks easiest to use for now.
https://github.com/sohobloo/react-native-modal-dropdown
I’m using this dropdown picker inside a modal and I have the exact same issue. I’ve removed the zIndex for android devices but I still can’t select any items from the dropdown list. this is the code from my custom styles related to the zIndex:
...(Platform.OS !== 'android' && { zIndex: 11 }),