Topic: Need action for X icon in search input

jederrick free asked 4 years ago

Expected behavior

I want to trigger an action for X icon in search input

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">

Arkadiusz Idzikowski staff answered 4 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):

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:


Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: 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