Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Select2 css is not implementing


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"
{...formik.getFieldProps("departmentId")}
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>

Anybody can help me? Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Zahid,

For a solution, you can refer to my reply in this post.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(