Hello ,
I am using select2 dropdown search in react , but its css i think is not implementing as i am adding ;form-select' class with select but despite of it select2 dropdown layout is very common and unprofessional in metronic template react .As i want to apply dropdown search like it is in html .
here is the sample of code i used in react
<div classname="d-flex flex-column mb-7 fv-row">
<label classname="fs-6 fw-semibold mb-2">
<span classname="required">Department</span>
<i classname="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Department"></i>
</label>
<select classname="form-select form-select-solid fw-bold" name="departmentId" data-kt-select2="true" data-control="select2" id="departments" data-placeholder="Select a Department..." data-dropdown-parent="#kt_modal_add_user">
<option></option>
{MUMdepartmentsList?.map((department) => (
<>
<option value="{department.id}">{department.departmentNameEn}</option>
>
))}
</select>
{formik.touched.departmentId && formik.errors.departmentId && (
<div classname="fv-plugins-message-container">
<div classname="fv-help-block">{formik.errors.departmentId}</div>
</div>
)}
</div>
Hi Zahid,
For a solution, you can refer to my reply in this post.
Regards,
Lauris Stepanovs,
Keenthemes Support Team