add proper pattern validation

This commit is contained in:
Víctor Losada Hernández committed 2026-10-30 00:30:44 +01:00
1 parent 89667f38b5
commit f5056049eb
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -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