Skip to content

Commit

Permalink
Merge pull request #327 from hossein-zare/dev-5.x
Browse files Browse the repository at this point in the history
v5.1.16
  • Loading branch information
hossein-zare authored May 23, 2021
2 parents a615017 + 86ad915 commit b294b42
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 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.15",
"version": "5.1.16",
"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 Expand Up @@ -43,6 +43,9 @@
"author": "Hossein Zare",
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"react-native-gesture-handler": "*"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
Expand Down
3 changes: 2 additions & 1 deletion src/components/ListEmpty.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { memo } from 'react';

import {
View, Text
View,
Text
} from 'react-native';

function ListEmpty({loading, message, ActivityIndicatorComponent, listMessageContainerStyle, listMessageTextStyle}) {
Expand Down
5 changes: 3 additions & 2 deletions src/components/Picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import React, {
import {
View,
Text,
TouchableOpacity,
Image,
FlatList,
TextInput,
Expand All @@ -23,6 +22,8 @@ import {
StyleSheet
} from 'react-native';

import { TouchableOpacity } from 'react-native-gesture-handler';

const {height: WINDOW_HEIGHT} = Dimensions.get('window');

import Colors from '../constants/colors';
Expand Down Expand Up @@ -351,7 +352,7 @@ function Picker({
results.splice(index, 0, parent);
});

if (results.length === 0 && addCustomItem) {
if ((results.length === 0 || results.findIndex(item => item[_schema.label].toLowerCase() === searchText.toLowerCase()) === -1) && addCustomItem) {
results.push({
[_schema.label]: searchText,
[_schema.value]: searchText.replace(' ', '-'),
Expand Down
3 changes: 2 additions & 1 deletion src/components/RenderBadgeItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import React, {
} from 'react';

import {
TouchableOpacity,
View,
Text,
} from 'react-native';

import { TouchableOpacity } from 'react-native-gesture-handler';

import { RTL_DIRECTION, RTL_STYLE } from '../constants';

function RenderBadge({
Expand Down
3 changes: 2 additions & 1 deletion src/components/RenderListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import React, {

import {
Text,
TouchableOpacity
} from 'react-native';

import { TouchableOpacity } from 'react-native-gesture-handler';

function RenderListItem({
rtl,
item,
Expand Down

0 comments on commit b294b42

Please sign in to comment.