mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 21:52:43 +00:00
allow strings for filterOn
This commit is contained in:
@@ -84,8 +84,7 @@ const Combobox = createClass({
|
|||||||
if(!this.state.showDropdown) return null;
|
if(!this.state.showDropdown) return null;
|
||||||
if(this.props.autoSuggest && !this.state.inputFocused){
|
if(this.props.autoSuggest && !this.state.inputFocused){
|
||||||
const suggestMethod = this.props.autoSuggest.suggestMethod;
|
const suggestMethod = this.props.autoSuggest.suggestMethod;
|
||||||
const filterOn = this.props.autoSuggest.filterOn;
|
const filterOn = _.isString(this.props.autoSuggest.filterOn) ? [this.props.autoSuggest.filterOn] : this.props.autoSuggest.filterOn;
|
||||||
|
|
||||||
const filteredArrays = filterOn.map((attr)=>{
|
const filteredArrays = filterOn.map((attr)=>{
|
||||||
const children = dropdownChildren.filter((item)=>{
|
const children = dropdownChildren.filter((item)=>{
|
||||||
if(suggestMethod === 'includes'){
|
if(suggestMethod === 'includes'){
|
||||||
|
|||||||
@@ -247,7 +247,8 @@ const MetadataEditor = createClass({
|
|||||||
suggestMethod : 'startsWith',
|
suggestMethod : 'startsWith',
|
||||||
clearAutoSuggestOnClick : true,
|
clearAutoSuggestOnClick : true,
|
||||||
filterOn : ['data-value', 'data-detail', 'title']
|
filterOn : ['data-value', 'data-detail', 'title']
|
||||||
}}>
|
}}
|
||||||
|
>
|
||||||
</Combobox>
|
</Combobox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user