mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 16:08:54 +00:00
add proper pattern validation
This commit is contained in:
@@ -14,7 +14,7 @@ const Combobox = ({
|
||||
suggestMethod : 'includes',
|
||||
filterOn : [] // should allow as array to filter on multiple attributes, or even custom filter
|
||||
},
|
||||
valuePatterns = /.+/,
|
||||
valuePatterns = '.+',
|
||||
options = [],
|
||||
keepValueOnClose = false,
|
||||
...props
|
||||
|
||||
@@ -264,6 +264,7 @@ const MetadataEditor = ({
|
||||
defaultValue={metadata.lang || ''}
|
||||
keepValueOnClose={true}
|
||||
placeholder='en'
|
||||
valuePatterns="^[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?$"
|
||||
onSelect={(value)=>handleLanguage(value)}
|
||||
onEntry={(e)=>{
|
||||
e.target.setCustomValidity(''); //Clear the validation popup while typing
|
||||
|
||||
Reference in New Issue
Block a user