From f79aaff297aae6a5f491ffad93f150a12924015b Mon Sep 17 00:00:00 2001 From: Phil Myers Date: Tue, 27 Feb 2018 13:23:55 -0500 Subject: [PATCH] Check whether the query key has a value rather than whether it's truthy --- components/autocomplete/Autocomplete.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/autocomplete/Autocomplete.js b/components/autocomplete/Autocomplete.js index 16354852..ab0ad309 100644 --- a/components/autocomplete/Autocomplete.js +++ b/components/autocomplete/Autocomplete.js @@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import classnames from 'classnames'; import { themr } from 'react-css-themr'; +import { isValuePresent } from '../utils/utils'; import { AUTOCOMPLETE } from '../identifiers.js'; import InjectChip from '../chip/Chip.js'; import InjectInput from '../input/Input.js'; @@ -184,7 +185,7 @@ const factory = (Chip, Input) => { query(key) { let query_value = ''; - if (!this.props.multiple && key) { + if (!this.props.multiple && isValuePresent(key)) { const source_value = this.source().get(`${key}`); query_value = source_value || key; }