material icon indicating copy to clipboard operation
material copied to clipboard

clear ng-model on md-select does not work when multiple

Open myagoo opened this issue 11 years ago • 7 comments

mdSelect does not refresh view value when multiple is true and value is set to undefined.

Here is an example pen forked from validation demo of mdSelect directive http://codepen.io/myagoo/pen/jPMOwZ

myagoo avatar May 20 '15 08:05 myagoo

+1

ByJC avatar May 20 '15 08:05 ByJC

+1

whoknows avatar May 20 '15 08:05 whoknows

Any workaround while waiting for this to be fixed ? This bug is really annoying, we use md-select to build a generic selector abstraction in our application and we are unable to reset them >< Also, I updated the associated codepen as it seemed everything worked fine.

myagoo avatar Jun 01 '15 14:06 myagoo

i use ng-if to recreate the md-select when i click on the reset button as a temporary workaround

<md-select ng-if='recreateSelect'>

$scope.recreateSelect = true;
$scope.reset = function() {
    $scope.recreateSelect = false;
    $timeout(function() {
        $scope.recreateSelect = true;
    }, 100);

sckoh avatar Jun 03 '15 04:06 sckoh

@sckoh Good workaround ! I prefer to use a timeout 0 to avoid the blink effect.

Masadow avatar Jun 24 '15 13:06 Masadow

@sckoh Thank you! Exactly the problem I was facing. Great solution.

anjroo avatar Jul 02 '15 14:07 anjroo

When the fix will be available for this issue ?

naresh8t7 avatar Aug 14 '15 01:08 naresh8t7