-
Notifications
You must be signed in to change notification settings - Fork 370
pattern attribute for language propery is invalid #4813
Copy link
Copy link
Open
Labels
P2 - minor feature or not urgentMinor bugs or less-popular featuresMinor bugs or less-popular featuresUI/UXUser Interface, user experienceUser Interface, user experiencebugWe say this works but it doesn'tWe say this works but it doesn'tsolution foundA solution exists; just needs to be appliedA solution exists; just needs to be appliedtweakSmall, non-breaking changeSmall, non-breaking change
Metadata
Metadata
Assignees
Labels
P2 - minor feature or not urgentMinor bugs or less-popular featuresMinor bugs or less-popular featuresUI/UXUser Interface, user experienceUser Interface, user experiencebugWe say this works but it doesn'tWe say this works but it doesn'tsolution foundA solution exists; just needs to be appliedA solution exists; just needs to be appliedtweakSmall, non-breaking changeSmall, non-breaking change
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently, the input for the Language property is:
That pattern is bad. The slashes should not be there (it's html, not javascript). It looks like that's the default pattern value from our function.
It should be more like this:
That, btw, also allows for the rare 3 letter regions, 4 letter scripts (e.g.
Hantfor traditional Chinese), and then the final 2 letter language. (We have both in the example drop-list for the input).The default
patternattribute value is defined here, as a javascript literal, but should be as a string, and looks to be inserted as a string of the literal js regex:homebrewery/client/components/combobox.jsx
Line 20 in 989ac07
The custom combobox for language is defined here, it looks to be using the default combobox pattern (which is itself bugged), should have
pattern="^[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?$"inserted.homebrewery/client/homebrew/editor/metadataEditor/metadataEditor.jsx
Lines 257 to 278 in 989ac07
The above 2 suggestions modulo a better understanding of React. I don't even know the assumed syntax for
valuePatterns.