From f3eed81aa4fefb77083bfc5875a12abc1c020780 Mon Sep 17 00:00:00 2001 From: Hoa Phan Date: Fri, 11 Oct 2024 15:23:31 +0700 Subject: [PATCH] fix: fix bugs --- README.md | 2 ++ example/src/dropdown/Dropdown1.tsx | 2 +- example/src/dropdown/MultiSelectAll.tsx | 20 ++++++++++++++++---- src/components/Dropdown/index.tsx | 20 +++++++++++++++----- src/components/Dropdown/model.ts | 1 + src/components/MultiSelect/index.tsx | 19 ++++++++++++++----- src/components/MultiSelect/model.ts | 1 + 7 files changed, 50 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a603091..647040a 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ yarn add react-native-element-dropdown | searchQuery | (keyword: string, labelValue: string) => Boolean| No | Callback used to filter the list of items | | inputSearchStyle | ViewStyle | No | Styling for input search | | searchPlaceholder | String | No | The string that will be rendered before text input has been entered | +| searchPlaceholderTextColor | String | No | The text color of the placeholder string | | renderInputSearch | (onSearch: (text:string) => void) => JSX.Element| No | Customize TextInput search | | disable | Boolean | No | Specifies the disabled state of the Dropdown | | dropdownPosition | 'auto' or 'top' or 'bottom' | No | Dropdown list position. Default is 'auto' | @@ -125,6 +126,7 @@ yarn add react-native-element-dropdown | searchQuery | (keyword: string, labelValue: string) => Boolean | No | Callback used to filter the list of items | | inputSearchStyle | ViewStyle | No | Styling for input search | | searchPlaceholder | String | No | The string that will be rendered before text input has been entered | +| searchPlaceholderTextColor | String | No | The text color of the placeholder string | | renderInputSearch | (onSearch: (text:string) => void) => JSX.Element | No | Customize TextInput search | | disable | Boolean | No | Specifies the disabled state of the Dropdown | | dropdownPosition | 'auto' or 'top' or 'bottom' | No | Dropdown list position. Default is 'auto' | diff --git a/example/src/dropdown/Dropdown1.tsx b/example/src/dropdown/Dropdown1.tsx index 9b95a8a..9cc0492 100644 --- a/example/src/dropdown/Dropdown1.tsx +++ b/example/src/dropdown/Dropdown1.tsx @@ -45,7 +45,7 @@ const DropdownComponent = () => { inputSearchStyle={styles.inputSearchStyle} iconStyle={styles.iconStyle} data={data} - excludeSearchItems={excludeItem} + excludeItems={excludeItem} autoScroll search maxHeight={300} diff --git a/example/src/dropdown/MultiSelectAll.tsx b/example/src/dropdown/MultiSelectAll.tsx index a8ce200..c70eedd 100644 --- a/example/src/dropdown/MultiSelectAll.tsx +++ b/example/src/dropdown/MultiSelectAll.tsx @@ -1,6 +1,6 @@ import React, { useRef, useState } from 'react'; -import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'; -import { MultiSelect } from 'react-native-element-dropdown'; +import { Button, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import { IMultiSelectRef, MultiSelect } from 'react-native-element-dropdown'; const data = [ { label: 'Item 1', value: '1' }, @@ -20,7 +20,7 @@ const excludeItem = [ const MultiSelectComponent = () => { const [selected, setSelected] = useState([]); - const ref = useRef(null); + const ref = useRef(null); const onSelectAll = (isSelectAll = true) => { const selectItem: string[] = []; @@ -71,6 +71,14 @@ const MultiSelectComponent = () => { selectedStyle={styles.selectedStyle} flatListProps={{ ListHeaderComponent: renderSelectAllIcon }} /> + +