Topic: Need action for X icon in search input
Expected behavior
I want to trigger an action for X icon in search input https://mdbootstrap.com/docs/jquery/forms/autocomplete/
Actual behavior
Right now X icon only clear the text in the input.
Resources (screenshots, code snippets etc.)
<div class="md-form">
<input type="search" id="form-autocomplete" class="form-control mdb-autocomplete">
</div>
Arkadiusz Idzikowski staff answered 5 years ago
I'm not sure which MDB library do you use, because you added question to Angular section and provided link to jQuery documentation.
If this question is about MDB Angular autocompleter component, please take a look at the API section of our documentation (switch tab to API at the top of the page):
https://mdbootstrap.com/docs/angular/forms/autocomplete/
There is (clearButtonClicked)
output that you can listen to. Just add this code to the autocomplete input element and create implementation for onClearButtonClick()
method in your ts file:
(clearBtnClicked)="onClearButtonClick()"
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: 8.8.2
- Device: PC
- Browser: Chrome
- OS: Ubuntu
- Provided sample code: No
- Provided link: Yes