|
@@ -92,7 +92,7 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
|
|
|
typeaheadIndex: 0,
|
|
typeaheadIndex: 0,
|
|
|
typeaheadPrefix: '',
|
|
typeaheadPrefix: '',
|
|
|
typeaheadText: '',
|
|
typeaheadText: '',
|
|
|
- value: makeValue(props.initialQuery, props.syntax),
|
|
|
|
|
|
|
+ value: makeValue(props.initialQuery || '', props.syntax),
|
|
|
lastExecutedValue: null,
|
|
lastExecutedValue: null,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
@@ -420,6 +420,10 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
|
|
|
updateMenu = () => {
|
|
updateMenu = () => {
|
|
|
const { suggestions } = this.state;
|
|
const { suggestions } = this.state;
|
|
|
const menu = this.menuEl;
|
|
const menu = this.menuEl;
|
|
|
|
|
+ // Exit for unit tests
|
|
|
|
|
+ if (!window.getSelection) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const selection = window.getSelection();
|
|
const selection = window.getSelection();
|
|
|
const node = selection.anchorNode;
|
|
const node = selection.anchorNode;
|
|
|
|
|
|