AngularJS conditional ng-disabled does not re-enable

前端 未结 3 2051
死守一世寂寞
死守一世寂寞 2021-02-06 21:47

Given a conditionally disabled text input field using ng-disabled=\"truthy_scope_variable\", AngularJS disables the field the first time the scope variable

3条回答
  •  离开以前
    2021-02-06 22:36

    As of 2016 March the binded values will update the ui in Chrome and Firefox even when the ng-disabled is true but not in Safari. In Safari when you use ng-disabled the ui wont update although the input element value property will have the updated value (Check element.value after changing it.)

    In Safari to force the ui updates with ng-model or ng-value directives you have to use ng-readonly instead of ng-disabled.

提交回复
热议问题