@samitouri / QOSami-HFS / commits / 57a196c2

admin/options: avoid inputting 'auto' with a different case in mime types

Massimo Melina committed Oct 12, 2023 at 11:43 UTC 57a196c2d0a28e38e8802e875f667e79677e58af
2 files changed +6 -6
admin/src/OptionsPage.ts
+1 -1
@@ -172,7 +172,7 @@ export default function OptionsPage() {
172 color: 'warning.main', ml: 1
173 }))
174 } },
175 - { k: 'v', label: "Mime type", $width: 2 },
175 + { k: 'v', label: "Mime type", fromField: _.toLower, $width: 2 },
176 ],
177 toField: x => Object.entries(x || {}).map(([k,v]) => ({ k, v })),
178 fromField: x => Object.fromEntries(x.map((row: any) => [row.k, row.v])),
mui-grid-form/StringField.ts
+5 -5
@@ -68,11 +68,11 @@ export function StringField({ value, onChange, min, max, required, setApi, typin
68 return !suggestions ? render(null)
69 : h(Autocomplete, { freeSolo: true, options: suggestions, renderInput: render })
70
71 - function go(event: any, val: string=state) {
72 - const newV = val.trim()
73 - if (newV === lastChange.current) return // don't compare to 'value' as that represents only accepted changes, while we are interested also in changes through discarded values
74 - lastChange.current = newV
75 - onChange(newV, {
71 + function go(event: any, newVal: string=state) {
72 + newVal = newVal.trim()
73 + if (newVal === lastChange.current) return // don't compare to 'value' as that represents only accepted changes, while we are interested also in changes through discarded values
74 + lastChange.current = newVal
75 + onChange(newVal, {
76 was: value,
77 event,
78 cancel() {