Skip to content

Commit

Permalink
Merge pull request #320 from hossein-zare/dev-5.x
Browse files Browse the repository at this point in the history
5.1.15
  • Loading branch information
hossein-zare authored May 14, 2021
2 parents cf484e7 + 1bd0d40 commit a615017
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-dropdown-picker",
"version": "5.1.14",
"version": "5.1.15",
"description": "A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.",
"keywords": [
"picker",
Expand Down
16 changes: 10 additions & 6 deletions src/components/Picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function Picker({
badgeSeparatorStyle = {},
listMode = LIST_MODE.DEFAULT,
categorySelectable = true,
searchable = true,
searchable = false,
searchPlaceholder = null,
schema = {},
language = LANGUAGE.DEFAULT,
Expand Down Expand Up @@ -596,8 +596,12 @@ function Picker({
* @returns {number}
*/
const _zIndex = useMemo(() => {
return direction === 'top' ? zIndex : zIndexInverse;
}, [zIndex, zIndexInverse, direction]);
if (open) {
return direction === 'top' ? zIndex : zIndexInverse;
}

return zIndex;
}, [zIndex, zIndexInverse, direction, open]);

/**
* The style.
Expand Down Expand Up @@ -1548,8 +1552,8 @@ function Picker({
const pointerEvents = useMemo(() => disabled ? "none" : "auto", [disabled]);

return (
<View style={_containerStyle} {...containerProps} pointerEvents={pointerEvents}>
<TouchableOpacity style={_style} onPress={__onPress} onLayout={__onLayout} {...props} ref={onRef}>
<View style={_containerStyle} {...containerProps}>
<TouchableOpacity style={_style} onPress={__onPress} onLayout={__onLayout} {...props} ref={onRef} pointerEvents={pointerEvents} disabled={disabled}>
{_BodyComponent}
{_ArrowComponent}
</TouchableOpacity>
Expand All @@ -1564,4 +1568,4 @@ const styles = StyleSheet.create({
}
});

export default memo(Picker);
export default memo(Picker);

0 comments on commit a615017

Please sign in to comment.