mdl-textfield not taking ngModel changes into account

前端 未结 3 1213
礼貌的吻别
礼貌的吻别 2021-01-06 14:34

I am facing an issue regarding the mdl-textfield\'s behavior

On the below plnkr, follow the steps:

  1. click on \"groups working\"
  2. cl
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-06 15:03

    You have to manually clean up MDL js text inputs if cleared via scripting. After clearing input value, for example, call this mdlCleanup();.

      //MDL Text Input Cleanup
      function mdlCleanUp(){
        var mdlInputs = doc.querySelectorAll('.mdl-js-textfield');
        for (var i = 0, l = mdlInputs.length; i < l; i++) {
          mdlInputs[i].MaterialTextfield.checkDirty();
        }  
      }
    

提交回复
热议问题