From b49b5efae057cc638811e7e2950fc4b2a97c0c19 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sun, 3 Apr 2016 19:41:25 -0400 Subject: [PATCH] [fixed] #322 --- src/util/dataHelpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/dataHelpers.js b/src/util/dataHelpers.js index 128dc56bf..419aaf9a4 100644 --- a/src/util/dataHelpers.js +++ b/src/util/dataHelpers.js @@ -43,14 +43,14 @@ export function valueMatcher(a, b, valueField){ dataValue(a, valueField), dataValue(b, valueField)) } -export function dataItem(data, item, valueField){ +export function dataItem(data, item, valueField) { var first = data[0] , idx; // make an attempt to see if we were passed in dataItem vs just a valueField value // either an object with the right prop, or a primitive // { valueField: 5 } || "hello" [ "hello" ] - if (has(item, valueField) || typeof first === typeof val) + if (has(item, valueField) || typeof first === typeof item) return item idx = dataIndexOf(data, dataValue(item, valueField), valueField)