Search code examples
javascriptangularjsangular-materialmd-autocomplete

md-autocomplete md-clear-button="true" does not show the clear button


I have the issue with <md-autocomplete> component which is shown in this demo:

<md-autocomplete md-clear-button="true"> does not work. I would expect that a cross is shown at the end of the input field, like it is shown for official Basic Usage demo.

If someone can update the my demo so that clear button works, I will appreciate.


Solution

  • This actually works fine in current version v1.1.4 (perhaps above v1.1.2). See demo here.

    Also, it seems this was intentional behavior while using md-floating-label for md-autocomplete according to some GitHub issues (#2727 and #7800)

    If you don't have a choice of updating the angular-material version, you can have a look at this comment which turns out to be a somewhat applauded work-around.

    Hope that helps!