fix(create-filter-modal): Verhindert unkontrollierte bis kontrollierte Eingabewarnungen in CreateFilterModal

This commit is contained in:
2025-07-09 11:10:47 +02:00
parent d7e3e500ab
commit 15fe1dfec6

View File

@@ -27,15 +27,15 @@ type ModalProps = {
}
export default function CreateFilterModal({ open, handleClose }: ModalProps) {
const [name, setName] = useState<string | undefined>(undefined);
const [label, setLabel] = useState<string | undefined>(undefined);
const [selectedType, setSelectedType] = useState<Type | undefined>(undefined);
const [name, setName] = useState<string | undefined>('');
const [label, setLabel] = useState<string | undefined>('');
const [selectedType, setSelectedType] = useState<Type | null>(null);
function closeReset() {
handleClose();
setName(undefined);
setLabel(undefined)
setSelectedType(undefined)
setName('');
setLabel('')
setSelectedType(null)
}
async function tryCreateFilter(): Promise<any> {
@@ -65,7 +65,7 @@ export default function CreateFilterModal({ open, handleClose }: ModalProps) {
disablePortal
options={filterTypes}
value={selectedType}
onChange={(event, newValue) => setSelectedType(newValue ?? undefined)}
onChange={(event, newValue) => setSelectedType(newValue)}
renderInput={params => <TextField {...params} label="Type" variant="filled" />}
/>
<Button