mdAutocomplete in mdChips : Can't remove chip on Safari 9 with md-min-length="0"
Not sure if it's a bug with angular-material or something else.
I slightly modified the Custom Inputs demo : codepen.
I added md-min-length="0" to the autocomplete component and return the full array if no query text is entered : var results = query ? self.vegetables.filter(createFilterFor(query)) : self.vegetables;.
With these options, after entering some values in the third input, Safari 9 can't remove the chip by clicking on the cross. Other browsers are fine.
I'll try looking more into it but if anyone has ideas, I'd be happy to hear them.
I am facing the same issue. Please give your suggestion .
In Chrome & firefox works fine
I can definitely see the bug. The funny thing is that it appears to be a bit finicky. For instance, when I opened the developer tools (trying to inspect the close buttons), it started working like 95% of the time and I had trouble reproducing it. Close the dev tools and refresh, though, and I could only get it to work like 5% of the time. So strange...
Anyway, we'll look into it, but in the meantime, let us know if you find a workaround or can dig in to find the underlying issue.
I am trying to find workaround but did not find any workaround till now ....if anybody find please share .
This issue is closed as part of our ‘Surge Focus on Material 2' efforts. For details, see our forum posting @ http://bit.ly/1UhZyWs.
there is 2 workaround for this bug:
-
remove md-min-length="0" from the md-autocomplete.
-
override mdChipRemove directive function MdChipRemove ($timeout) { return { restrict: 'A', require: '^mdChips', scope: false, link: postLink };
function postLink(scope, element, attr, ctrl) { element.on('click mousedown', function(event) { if (event.which !== 1) { return; } scope.$apply(function() { ctrl.removeChip(scope.$$replacedScope.$index); }); }); $timeout(function() { element.attr({tabindex: -1, 'aria-hidden': true}); element.find('button').attr('tabindex', '-1'); }); }}