From f64092c8bf4cd19092c434614e002f1a3a135c6c Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Mon, 4 May 2026 11:25:35 +0200 Subject: [PATCH] Refactor ds-search-navbar so the
is only rendered when expanded Pa11y/HTMLCS rule WCAG2AA H32.2 ("This form does not contain a submit button") fires on every page because the navbar search renders a even while collapsed, and the icon control inside it is type="button" (it has to be: in collapsed state its job is to expand the input, not to submit). Functionally, Enter still submits the search via HTML5 implicit submission on a single-input form, so this is a false positive in behavioural terms. The rule is, however, pointing at a real semantic ambiguity: the icon button's role depends on whether the search is collapsed or expanded. Restructure the template so: - when collapsed, only a single -
+ } @else { +
+ + +
+ } diff --git a/src/app/search-navbar/search-navbar.component.spec.ts b/src/app/search-navbar/search-navbar.component.spec.ts index 095c4c5d223..a951981c819 100644 --- a/src/app/search-navbar/search-navbar.component.spec.ts +++ b/src/app/search-navbar/search-navbar.component.spec.ts @@ -70,13 +70,24 @@ describe('SearchNavbarComponent', () => { expect(component).toBeTruthy(); }); - describe('when you click on search icon', () => { + describe('when collapsed', () => { + it('should render only the toggle