-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NgbRadio disabled does not work. #1088
Comments
I've found the culprit. It is in here: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/buttons/radio.ts#L142 It should be:
I am guessing it makes sense to also change The tests are failing because this seems to be caused by the @pkozlowski-opensource I will try to submit a PR today if this makes sense to you. |
@alex321 PRs are always welcomed. Just please make sure to add a test(s) so we don't introduce regressions in the future. Thnx! |
There's a further point to this should you wish to incorporate into a single PR: @Input('disabled')
set disabled(value: any) {
this._disabled = this._element.nativeElement.hasAttribute('disabled') ? true : value; does not reflect any passed in directive as value. Should include this._renderer.setElementProperty(this._element.nativeElement, 'disabled', this._disabled); or similar |
@leekiernan I don't think that your last comment is valid since the I guess you were thinking of an attribute but we are setting a property here (and then an element might choose to reflect this property as an attribute). |
Apologies I don't think I expressed myself well above. I looked at @alex321 PR and it appeared to implement the binding that I was trying to bring up. |
Adding the disabled attribute to an input is removed on page load. Success in tests however it appears that the browser does two passes, removing this attribute on the second.
http://plnkr.co/edit/9udhxszOhPKZAEWcccmi
Versions:
Angular: 2.0.0, 2.1.1
NGbootstrap: 1.0.0-alpha.9, 1.0.0-alpha.14
Bootstrap: 4.0.0-alpha.5, 4.0.0-alpha.2
Stacktrace:
The text was updated successfully, but these errors were encountered: