mirror of
https://github.com/maputnik/editor.git
synced 2026-07-31 18:27:28 +00:00
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:
@@ -70,7 +70,9 @@ class AutocompleteInput extends React.Component {
|
|||||||
onSelect={v => this.props.onChange(v)}
|
onSelect={v => this.props.onChange(v)}
|
||||||
onChange={(e, v) => this.props.onChange(v)}
|
onChange={(e, v) => this.props.onChange(v)}
|
||||||
shouldItemRender={(item, value="") => {
|
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) => (
|
renderItem={(item, isHighlighted) => (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user