mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-16 18:48:44 +00:00
add proper pattern validation
This commit is contained in:
@@ -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