fix(create-filter-modal): Verhindert unkontrollierte bis kontrollierte Eingabewarnungen in CreateFilterModal
This commit is contained in:
@@ -27,15 +27,15 @@ type ModalProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function CreateFilterModal({ open, handleClose }: ModalProps) {
|
export default function CreateFilterModal({ open, handleClose }: ModalProps) {
|
||||||
const [name, setName] = useState<string | undefined>(undefined);
|
const [name, setName] = useState<string | undefined>('');
|
||||||
const [label, setLabel] = useState<string | undefined>(undefined);
|
const [label, setLabel] = useState<string | undefined>('');
|
||||||
const [selectedType, setSelectedType] = useState<Type | undefined>(undefined);
|
const [selectedType, setSelectedType] = useState<Type | null>(null);
|
||||||
|
|
||||||
function closeReset() {
|
function closeReset() {
|
||||||
handleClose();
|
handleClose();
|
||||||
setName(undefined);
|
setName('');
|
||||||
setLabel(undefined)
|
setLabel('')
|
||||||
setSelectedType(undefined)
|
setSelectedType(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function tryCreateFilter(): Promise<any> {
|
async function tryCreateFilter(): Promise<any> {
|
||||||
@@ -65,7 +65,7 @@ export default function CreateFilterModal({ open, handleClose }: ModalProps) {
|
|||||||
disablePortal
|
disablePortal
|
||||||
options={filterTypes}
|
options={filterTypes}
|
||||||
value={selectedType}
|
value={selectedType}
|
||||||
onChange={(event, newValue) => setSelectedType(newValue ?? undefined)}
|
onChange={(event, newValue) => setSelectedType(newValue)}
|
||||||
renderInput={params => <TextField {...params} label="Type" variant="filled" />}
|
renderInput={params => <TextField {...params} label="Type" variant="filled" />}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user