mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-26 00:52:48 +00:00
Debounce validation on Lang field
This commit is contained in:
@@ -126,4 +126,4 @@ const Combobox = createClass({
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = Combobox;
|
||||
module.exports = Combobox;
|
||||
|
||||
@@ -245,6 +245,7 @@ const MetadataEditor = createClass({
|
||||
});
|
||||
};
|
||||
|
||||
const debouncedHandleFieldChange = _.debounce(this.handleFieldChange, 500);
|
||||
|
||||
return <div className='field language'>
|
||||
<label>language</label>
|
||||
@@ -254,7 +255,9 @@ const MetadataEditor = createClass({
|
||||
default={this.props.metadata.lang || ''}
|
||||
placeholder='en'
|
||||
onSelect={(value)=>this.handleLanguage(value)}
|
||||
onEntry={(e)=>{this.handleFieldChange('lang', e);}}
|
||||
onEntry={(e)=> { e.target.setCustomValidity(''); //Clear the validation popup while typing
|
||||
debouncedHandleFieldChange('lang', e);
|
||||
}}
|
||||
options={listLanguages()}
|
||||
autoSuggest={{
|
||||
suggestMethod : 'startsWith',
|
||||
|
||||
Reference in New Issue
Block a user