0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-22 08:58:11 +00:00

next stable

This commit is contained in:
Víctor Losada Hernández
2026-02-16 00:58:50 +01:00
parent 2a9970705b
commit dec91cc76e
4 changed files with 33 additions and 51 deletions

View File

@@ -16,6 +16,7 @@ const Combobox = createReactClass({
suggestMethod : 'includes',
filterOn : [] // should allow as array to filter on multiple attributes, or even custom filter
},
valuePatterns: [/.+/]
};
},
getInitialState : function() {
@@ -74,6 +75,7 @@ const Combobox = createReactClass({
type='text'
onChange={(e)=>this.handleInput(e)}
value={this.state.value || ''}
pattern={this.props.valuePatterns}
placeholder={this.props.placeholder}
onBlur={(e)=>{
if(!e.target.checkValidity()){
@@ -82,6 +84,12 @@ const Combobox = createReactClass({
});
}
}}
onKeyDown={(e)=>{
if (e.key === "Enter") {
e.preventDefault();
this.props.onEntry(e);
}
}}
/>
<i className='fas fa-caret-down'/>
</div>