Fix uibUncheckable for uibBtnRadio#6538
Fix uibUncheckable for uibBtnRadio#6538navarroaxel wants to merge 1 commit intoangular-ui:masterfrom
Conversation
fca5338 to
ec20a33
Compare
ec20a33 to
57a4dbd
Compare
There was a problem hiding this comment.
Please @icfantv can you review this? I need this fix for my project.
Thanks!
| it('should set uncheckable', function() { | ||
| it('should set disabled', function() { | ||
| $scope.uncheckable = false; | ||
| var btns = compileButtons('<button ng-model="model" uib-btn-radio="1">click1</button><button ng-model="model" uib-btn-radio="2" uib-uncheckable="uncheckable">click2</button>', $scope); |
There was a problem hiding this comment.
Why the tests was made with button tags and the demo was made with label tags?
|
|
||
| btns.eq(1).click(); | ||
| expect($scope.model).toBeNull(); | ||
| expect($scope.model).toEqual(1); |
There was a problem hiding this comment.
The test was wrong. If I click a disabled button the value should not change or should not be converted to null.
|
LGTM. Does anyone have any idea how soon or not this will be pulled into a release? This bug is impacting a project that is approaching beta launch, so I need to evaluate whether it's worth implementing a hack to work around the bug vs waiting for this fix to be merged. |
|
@zacronos this is my hack by the moment... gulp.task('fix:angular:bootstrap', () => {
// fix https://github.com/angular-ui/bootstrap/issues/6532
const path = './node_modules/angular-ui-bootstrap/src/buttons/';
return gulp.src(`${path}buttons.js`)
.pipe(require('gulp-replace')(
'attrs.$set(\'uncheckable\', uncheckable ? \'\' : undefined);',
'attrs.$set(\'disabled\', uncheckable ? \'disabled\' : undefined);'
))
.pipe(gulp.dest(path));
});this should run at clean stage, before the build. |
|
Thanks @navarroaxel for the fix. |
Fix #6532