From d7d2d5dd32b9cb22f6290b82ea3de45598bf37b5 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Fri, 17 Jun 2016 11:25:31 +0200 Subject: [PATCH] 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) --- DialogAndroid.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DialogAndroid.js b/DialogAndroid.js index 36905e0..aebe353 100644 --- a/DialogAndroid.js +++ b/DialogAndroid.js @@ -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); } }