[2] fix required
problem for project fields
This commit is contained in:
@ -70,7 +70,6 @@ export const CityCreate = () => {
|
||||
<Controller
|
||||
control={control}
|
||||
name="arms"
|
||||
rules={{required: 'Это поле является обязательным'}}
|
||||
defaultValue={null}
|
||||
render={({field}) => (
|
||||
<Autocomplete
|
||||
@ -88,7 +87,7 @@ export const CityCreate = () => {
|
||||
filterOptions={(options, {inputValue}) => {
|
||||
return options.filter((option) => option.filename.toLowerCase().includes(inputValue.toLowerCase()))
|
||||
}}
|
||||
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} required />}
|
||||
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} />}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
@ -69,7 +69,7 @@ export const CityEdit = () => {
|
||||
<Controller
|
||||
control={control}
|
||||
name="arms"
|
||||
rules={{required: 'Это поле является обязательным'}}
|
||||
// rules={{required: 'Это поле является обязательным'}}
|
||||
defaultValue={null}
|
||||
render={({field}) => (
|
||||
<Autocomplete
|
||||
@ -87,7 +87,7 @@ export const CityEdit = () => {
|
||||
filterOptions={(options, {inputValue}) => {
|
||||
return options.filter((option) => option.filename.toLowerCase().includes(inputValue.toLowerCase()))
|
||||
}}
|
||||
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} required />}
|
||||
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} />}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user