0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

add placeholder to input

This commit is contained in:
Gazook89
2022-11-24 23:33:04 -06:00
parent ce732778bb
commit e1ff34ebaa
2 changed files with 8 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ const Combobox = createClass({
className : '',
trigger : 'hover',
default : '',
placeholder : '',
autoSuggest : {
clearAutoSuggestOnClick : true,
suggestMethod : 'includes',
@@ -69,7 +70,12 @@ const Combobox = createClass({
<div className='dropdown-input item'
onMouseEnter={this.props.trigger == 'hover' ? ()=>{this.handleDropdown(true);} : undefined}
onClick= {this.props.trigger == 'click' ? ()=>{this.handleDropdown(true);} : undefined}>
<input type='text' onChange={(e)=>this.handleInput(e)} value={this.state.value || ''} />
<input
type='text'
onChange={(e)=>this.handleInput(e)}
value={this.state.value || ''}
placeholder={this.props.placeholder}
/>
</div>
);
},
@@ -84,7 +90,6 @@ const Combobox = createClass({
value : item.props[filterOn]
}));
if(suggestMethod === 'includes'){
console.log('includes');
dropdownChildren = dropdownChildren.filter((item)=>item.value.includes(this.state.value));
} else if(suggestMethod === 'sequential'){
dropdownChildren = dropdownChildren.filter((item)=>item.value.startsWith(this.state.value));