Skip to content

Commit

Permalink
fix(checkbox): remove autocomplete attribute (#3377)
Browse files Browse the repository at this point in the history
This attribute is yet to be supported by specs.

See: https://git.io/JesTb
Related issue/fix in Bootstrap twbs/bootstrap#28623  https://github.com/twbs/bootstrap/pullrequests/28952
  • Loading branch information
peterblazejewicz authored and Benoit Charbonnier committed Oct 15, 2019
1 parent 22c82a8 commit 39fea1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/buttons/checkbox.spec.ts
Expand Up @@ -172,6 +172,22 @@ describe('NgbCheckBox', () => {
}));
});

describe('auto attributes', () => {

it('should not have autocomplete attribute set to off', () => {
const fixture = createTestComponent(`
<label ngbButtonLabel>
<input type="checkbox" ngbButton>
</label>
`);

fixture.detectChanges();
const input = fixture.debugElement.nativeElement.querySelector('input');
expect(input.getAttribute('autocomplete')).toBeNull();
});

});

});

@Component({selector: 'test-cmp', template: ''})
Expand Down
1 change: 0 additions & 1 deletion src/buttons/checkbox.ts
Expand Up @@ -19,7 +19,6 @@ const NGB_CHECKBOX_VALUE_ACCESSOR = {
@Directive({
selector: '[ngbButton][type=checkbox]',
host: {
'autocomplete': 'off',
'[checked]': 'checked',
'[disabled]': 'disabled',
'(change)': 'onInputChange($event)',
Expand Down

0 comments on commit 39fea1f

Please sign in to comment.