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:
Vojtech Novak
2016-06-17 11:25:31 +02:00
committed by GitHub
parent b97a16904e
commit d7d2d5dd32
+3 -1
View File
@@ -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);
}
}