react-native-dropdown-picker
Advanced tools
Comparing version 3.6.1 to 3.6.2
{ | ||
"name": "react-native-dropdown-picker", | ||
"version": "3.6.1", | ||
"version": "3.6.2", | ||
"description": "A single or multiple, searchable item picker (dropdown) component for react native which supports both Android & iOS.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -188,16 +188,6 @@ | ||
// Single | ||
this.controller.select({ | ||
label: 'UK', | ||
value: 'uk', | ||
icon: () => {}, | ||
}); | ||
this.controller.selectItem('uk'); | ||
// Multiple | ||
this.controller.select([ | ||
{ | ||
label: 'UK', | ||
value: 'uk', | ||
icon: () => {}, | ||
} | ||
]); | ||
this.controller.selectItem(['uk', 'france']); | ||
``` | ||
@@ -204,0 +194,0 @@ 3. Add items manually. |
@@ -173,3 +173,5 @@ import React from 'react'; | ||
} else { | ||
this.select(items.find(item => item.value === defaultValue)); | ||
this.select( | ||
items.find(item => item.value === defaultValue) | ||
); | ||
} | ||
@@ -238,2 +240,20 @@ } else { | ||
selectItem(defaultValue) { | ||
if (this.state.props.multiple) { | ||
(async () => { | ||
for (const value of defaultValue) { | ||
await new Promise((resolve, reject) => { | ||
resolve( | ||
this.select(items.find(item => item.value === value)) | ||
); | ||
}); | ||
} | ||
})(); | ||
} else { | ||
this.select( | ||
this.state.props.items.find(item => item.value === defaultValue) | ||
); | ||
} | ||
} | ||
select(item) { | ||
@@ -240,0 +260,0 @@ const { multiple } = this.state.props; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80062
628
498