From 588b18d10e4656d76d84ae10a6b3053001981954 Mon Sep 17 00:00:00 2001 From: orangemug Date: Thu, 11 Oct 2018 21:38:35 +0100 Subject: [PATCH] Only render strings in the autocomplete menu. Expression objects were making there way into this menu which was crashing the editor. --- src/components/inputs/AutocompleteInput.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/inputs/AutocompleteInput.jsx b/src/components/inputs/AutocompleteInput.jsx index a2a5bf0..70ac561 100644 --- a/src/components/inputs/AutocompleteInput.jsx +++ b/src/components/inputs/AutocompleteInput.jsx @@ -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) => (