From 39fea1f3c2d407753f90958417f3a2a6a170929f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz=20=28Peter=20Blazejewicz=29?= Date: Tue, 15 Oct 2019 10:43:18 +0200 Subject: [PATCH] fix(checkbox): remove autocomplete attribute (#3377) This attribute is yet to be supported by specs. See: https://git.io/JesTb Related issue/fix in Bootstrap https://github.com/twbs/bootstrap/issues/28623 https://github.com/twbs/bootstrap/pullrequests/28952 --- 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)',