You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Select
styles={selectStyles}
id='document_type'
name='document_type'
placeholder='---'
isClearable
onBlur={formik.handleBlur}
value={document_type?.find(
(option) => option.id.toString() === formik.values.document_type
)}
options={document_type?.map((mapRow) => ({
id: mapRow.id,
name: mapRow.name_da,
}))}
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
onChange={(selectedOption) => {
formik.setFieldValue('document_type', selectedOption ? selectedOption.id : '')
}}
/>
this is my code i have set the inital value to formik and the inital value is an id from douments type but react select doesnt show to name of selected value but simple select option do it, the second problem is that if i reset the from values, the values are cleaning but lables still keeps in Select option
The text was updated successfully, but these errors were encountered:
if you're using next js 13 then also add the key props. e.g
<Select
defaultValue={selectedExaminersListFinal''}
isMulti
name="examiners"
options={examinerusers}
key={examinerusers}
onChange={handleChangeExaminer}
className="mt-1 block w-full"
classNamePrefix="select"
/>
<Select
styles={selectStyles}
id='document_type'
name='document_type'
placeholder='---'
isClearable
onBlur={formik.handleBlur}
value={document_type?.find(
(option) => option.id.toString() === formik.values.document_type
)}
options={document_type?.map((mapRow) => ({
id: mapRow.id,
name: mapRow.name_da,
}))}
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
onChange={(selectedOption) => {
formik.setFieldValue('document_type', selectedOption ? selectedOption.id : '')
}}
/>
this is my code i have set the inital value to formik and the inital value is an id from douments type but react select doesnt show to name of selected value but simple select option do it, the second problem is that if i reset the from values, the values are cleaning but lables still keeps in Select option
The text was updated successfully, but these errors were encountered: