From 7c5c14e0295d1016515cf706e093c0f22995d608 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 21 Sep 2019 19:49:52 +0200 Subject: [PATCH] fix(checkbox): remove autocomplete attribute This attribute is yet to be supported by specs. See: https://git.io/JesTb --- src/buttons/checkbox.spec.ts | 16 ++++++++++++++++ src/buttons/checkbox.ts | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/buttons/checkbox.spec.ts b/src/buttons/checkbox.spec.ts index 7fc49958bf..5f3378258e 100644 --- a/src/buttons/checkbox.spec.ts +++ b/src/buttons/checkbox.spec.ts @@ -172,6 +172,22 @@ describe('NgbCheckBox', () => { })); }); + describe('auto attributes', () => { + + it('should not have autocomplete attribute set to off', () => { + const fixture = createTestComponent(` + + `); + + fixture.detectChanges(); + const input = fixture.debugElement.nativeElement.querySelector('input'); + expect(input.getAttribute('autocomplete')).toBeNull(); + }); + + }); + }); @Component({selector: 'test-cmp', template: ''}) diff --git a/src/buttons/checkbox.ts b/src/buttons/checkbox.ts index 227ef98b9b..4e40e108bb 100644 --- a/src/buttons/checkbox.ts +++ b/src/buttons/checkbox.ts @@ -19,7 +19,6 @@ const NGB_CHECKBOX_VALUE_ACCESSOR = { @Directive({ selector: '[ngbButton][type=checkbox]', host: { - 'autocomplete': 'off', '[checked]': 'checked', '[disabled]': 'disabled', '(change)': 'onInputChange($event)',