Check whether the query key has a value rather than whether it's truthy
parent
1dafc5676f
commit
f79aaff297
|
@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { themr } from 'react-css-themr';
|
import { themr } from 'react-css-themr';
|
||||||
|
import { isValuePresent } from '../utils/utils';
|
||||||
import { AUTOCOMPLETE } from '../identifiers.js';
|
import { AUTOCOMPLETE } from '../identifiers.js';
|
||||||
import InjectChip from '../chip/Chip.js';
|
import InjectChip from '../chip/Chip.js';
|
||||||
import InjectInput from '../input/Input.js';
|
import InjectInput from '../input/Input.js';
|
||||||
|
@ -184,7 +185,7 @@ const factory = (Chip, Input) => {
|
||||||
|
|
||||||
query(key) {
|
query(key) {
|
||||||
let query_value = '';
|
let query_value = '';
|
||||||
if (!this.props.multiple && key) {
|
if (!this.props.multiple && isValuePresent(key)) {
|
||||||
const source_value = this.source().get(`${key}`);
|
const source_value = this.source().get(`${key}`);
|
||||||
query_value = source_value || key;
|
query_value = source_value || key;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue