When user enters an input with md-chips and the focus is removed the entry is still there. is there a way to delete any entry that is not a chip once the focus is removed? The Out Standing Text still shows once the focus is removed
相关问题
- Angular Mat Select CompareWith ID number, and Emit
- How to bind an click event for mat-step-header
- Mat expansion panel is opened by default bug?
- Angular-Material : md-select in md-dialog not clos
- Angular 6: npm ERR! cb() never called when install
相关文章
- Angular Material Stepper causes mat-formfield to v
- Angular material table not showing data
- MatToolbar throws error when using it with Angular
- How to create range slider (Angular Material) in A
- How to give fixed height to Angular Material Table
- Angular 5, Angular Material Checkbox with 3 states
- Angular mat-sidenav property isHandset$ | async ex
- Angular 6 Material: mat-tab-link be selected by un
Normally, you should be able to do it by using
ng-blur
but for some reason there is an issue with that directive in use withmd-autocomplete
: https://github.com/angular/material/issues/3906But i tried to solve it differently, not the most correct way, but it works. What you have to do is bind event with
blur
ininput
insidemd-autocomplete
. In this event you have to clear your searchText of md-autocomplete. So just bind that event in your controller somehow like that:The reason why I used timeout was the fact that chip was not added if searchText variable was cleared too fast. But when I added 300ms delay it worked as I expected. For sure there is better way to do it, but just try to do it this way and maybe it will be enough for you.
Here is working codepen: http://codepen.io/anon/pen/QdNydx