Skip to content

Commit f80b727

Browse files
sebastianthulinSebastian Thulin
and
Sebastian Thulin
authored
fix: separate the drawer and mobile search form (#1332)
Prevents duplicate ids Co-authored-by: Sebastian Thulin <sebastian.thulin@helsingborg.se>
1 parent 8532c0f commit f80b727

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

assets/source/3.0/sass/search.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ $search-border-radius: var(--c-search-form-border-radius, var(--c-field-border-r
6969
#hero-search-form,
7070
#header-search-form,
7171
#menu-mega,
72-
#mobile-search-form {
72+
#mobile-search-form,
73+
#drawer-search-form {
7374
&.c-form.search-form,
7475
.c-form {
7576
.c-field__inner,
@@ -86,7 +87,9 @@ $search-border-radius: var(--c-search-form-border-radius, var(--c-field-border-r
8687
#header-search-form input[type="search"],
8788
#header-search-form .c-field__inner,
8889
#mobile-search-form input[type="search"],
89-
#mobile-search-form .c-field__inner {
90+
#mobile-search-form .c-field__inner,
91+
#drawer-search-form input[type="search"],
92+
#drawer-search-form .c-field__inner {
9093
border-radius: inherit;
9194
border: none;
9295
}

views/v3/partials/navigation/drawer.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@slot('search')
3131
@includeWhen(
3232
$showMobileSearchDrawer,
33-
'partials.search.mobile-search-form',
33+
'partials.search.drawer-search-form',
3434
['classList' => ['search-form', 'u-margin__top--2', 'u-width--100']]
3535
)
3636
@endslot
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@form([
2+
'id' => 'drawer-search-form',
3+
'method' => 'get',
4+
'action' => $homeUrl,
5+
'classList' => $classList
6+
])
7+
@group(['direction' => 'horizontal', 'classList' => ['u-margin--auto']])
8+
@field([
9+
'id' => 'drawer-search-form__field',
10+
'type' => 'search',
11+
'name' => 's',
12+
'required' => false,
13+
'size' => 'sm',
14+
'radius' => 'sm',
15+
'borderless' => true,
16+
'label' => $lang->searchQuestion,
17+
'hideLabel' => true,
18+
'icon' => ['icon' => 'search'],
19+
'classList' => [
20+
'u-flex-grow--1',
21+
'u-box-shadow--1',
22+
]
23+
])
24+
@endfield
25+
26+
@button([
27+
'id' => 'drawer-search-form__submit',
28+
'text' => $lang->search,
29+
'color' => 'default',
30+
'type' => 'submit',
31+
'size' => 'sm',
32+
'attributeList' => [
33+
'aria-label' => $lang->search,
34+
],
35+
])
36+
@endbutton
37+
@endgroup
38+
@endform

0 commit comments

Comments
 (0)