Skip to content

Commit 8e99301

Browse files
committed
upgrade react-native-size-matters
1 parent ad4c5d0 commit 8e99301

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

example/components/CustomRightIconExample.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { memo, useState } from 'react'
2+
import { useRef } from 'react'
23
import { useMemo } from 'react'
34
import { Text, View } from 'react-native'
45
import { AutocompleteDropdown } from 'react-native-autocomplete-dropdown'
@@ -8,12 +9,16 @@ Feather.loadFont()
89

910
export const CustomRightIconExample = memo(() => {
1011
const [selectedItem, setSelectedItem] = useState(null)
12+
const dropdownController = useRef(null)
1113

1214
const dataSet = useMemo(generateDataSet, [])
1315

1416
return (
1517
<View>
1618
<AutocompleteDropdown
19+
controller={controller => {
20+
dropdownController.current = controller
21+
}}
1722
clearOnFocus={false}
1823
onSelectItem={setSelectedItem}
1924
dataSet={dataSet}
@@ -25,6 +30,9 @@ export const CustomRightIconExample = memo(() => {
2530
</Text>
2631
)}
2732
RightIconComponent={<Feather name="smile" size={18} color="#f55" />}
33+
onRightIconComponentPress={() => {
34+
dropdownController.current?.toggle()
35+
}}
2836
showChevron={false}
2937
/>
3038
<Text style={{ color: '#668', fontSize: 13 }}>Selected item: {JSON.stringify(selectedItem)}</Text>

example/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "react-native-autocomplete-dropdown-playground",
3-
"version": "1.2.0",
3+
"version": "2.1.0",
4+
"author": "Alexandr Kozhevnikov <[email protected]>",
5+
"license": "MIT",
46
"scripts": {
57
"android": "react-native run-android",
68
"ios": "react-native run-ios",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"dependencies": {
4646
"lodash.debounce": "*",
4747
"prop-types": "*",
48-
"react-native-size-matters": "^0.3.0 || ^0.4.0",
48+
"react-native-size-matters": "^0.4.0",
4949
"react-native-vector-icons": ">=7.0.0"
5050
},
5151
"bugs": {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,7 @@ react-is@^16.13.1:
28912891
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
28922892
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
28932893

2894-
"react-native-size-matters@^0.3.0 || ^0.4.0":
2894+
react-native-size-matters@^0.4.0:
28952895
version "0.4.0"
28962896
resolved "https://registry.yarnpkg.com/react-native-size-matters/-/react-native-size-matters-0.4.0.tgz#01bfd0d59454318f4e0b13fe9c1eb0523d70f2e0"
28972897
integrity sha512-8/C0htHrFWeUm9N8JegmadovUfgTWkGBkDPZ1N3YkXtDWb+98Ya2gThiKcu445r8c7YhcrBfnHz/mYsXIusaOQ==

0 commit comments

Comments
 (0)