mirror of
https://github.com/status-im/react-native-dialogs.git
synced 2026-08-31 03:01:10 +00:00
fix for NaN in case of a empty multi-selection
quick fix, although I'd say that serializing the result as JSON on the java side and simply passing it on on the js side would be nicer... (could do it, if you'd be interested)
This commit is contained in:
+3
-1
@@ -57,7 +57,9 @@ class DialogAndroid {
|
||||
callbacks.itemsCallbackMultiChoice = selected => {
|
||||
var indices = selected.split(',').map(x => parseInt(x));
|
||||
var elements = indices.map(ind => (finalOptions.items || [])[ind]);
|
||||
|
||||
if(indices.length === 1 && isNaN(indices[0])){
|
||||
indices=[] // the case of empty selection
|
||||
}
|
||||
originalCallback(indices, elements);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user