Only render strings in the autocomplete menu.

Expression objects were making there way into this menu which was crashing the editor.
This commit is contained in:
orangemug 2018-10-11 21:38:35 +01:00
parent 889005de6c
commit 588b18d10e

View file

@ -70,7 +70,9 @@ class AutocompleteInput extends React.Component {
onSelect={v => this.props.onChange(v)}
onChange={(e, v) => this.props.onChange(v)}
shouldItemRender={(item, value="") => {
return item[0].toLowerCase().indexOf(value.toLowerCase()) > -1
if (typeof(value) === "string") {
return item[0].toLowerCase().indexOf(value.toLowerCase()) > -1
}
}}
renderItem={(item, isHighlighted) => (
<div