-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(autocomplete): support readonly attribute #7107
Conversation
@@ -166,6 +167,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming, | |||
var wait = parseInt($scope.delay, 10) || 0; | |||
$attrs.$observe('disabled', function (value) { ctrl.isDisabled = !!value; }); | |||
$attrs.$observe('required', function (value) { ctrl.isRequired = !!value; }); | |||
$attrs.$observe('readonly', function (value) { ctrl.isReadonly = !!value; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This attribute needs to be fixed too (hopefully using the util method of #6803). Currently an empty readonly
won't work...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use ctrl.isReadonly = value !== null
for now? I think that should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robertmesserle Done - re-enabled test. I will rebase #6803 if this PR is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, once #6803 gets merged, these will all use your utility function, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, then the attributes will also work with an empty attribute value. And a little side-effect will be, that required="false"
also works. This won't break any existing versions, because it just adds false
and 0
as a negative value.
b5f1357
to
7d11647
Compare
@devversion - please rebase with |
7d11647
to
bf1a6ce
Compare
bf1a6ce
to
92af63e
Compare
@robertmesserle Please review :)
Fixes #5507