Topic: MDBSelect does not show search.
Malasharhan free asked 4 years ago
Expected behavior
I want to show search in MDBSelect. My code is as follow
<MDBSelect className="my-0" outline search searchLabel="Write here" selected={values.jobRoleId} getValue={val => {
helpers.triggerChangeEvent("jobRoleId", val[0]) }}>
<MDBSelectInput selected={t("COMMON.VALUES.UNDEFINED")} />
<MDBSelectOptions>
<MDBSelectOption disabled>{t("COMMON.VALUES.UNDEFINED")}</MDBSelectOption>
{jobRoles.map((item, index) => (
<MDBSelectOption key={index} value={item.id} checked={values.jobRoleId == item.id}>{item[`jobRole_${lang}`]}</MDBSelectOption>
))}
</MDBSelectOptions>
</MDBSelect>
Actual behavior
But does not show Searchbar
Jakub Chmura staff answered 4 years ago
Hi @Malasharhan,
The search bar in MDBSelect is only available when you use select with data array.
In the example above you use our select with markup.
Please check our documentation for more information:
https://mdbootstrap.com/docs/react/forms/select/
Best, Kuba
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.25.2
- Device: PC
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No