File tree Expand file tree Collapse file tree 3 files changed +36
-32
lines changed Expand file tree Collapse file tree 3 files changed +36
-32
lines changed Original file line number Diff line number Diff line change 2
2
3
3
module . exports = {
4
4
extends : [ 'octane' , 'a11y' ] ,
5
-
6
- pending : [ { moduleId : 'app/components/header' , only : [ 'no-duplicate-landmark-elements' ] } ] ,
7
5
} ;
Original file line number Diff line number Diff line change 5
5
<h1 >crates.io</h1 >
6
6
</LinkTo >
7
7
8
- <form local-class =" desktop- search-form" action =' /search' role =" search" {{ on " submit" (prevent-default this.search )}} data-test-search-form>
8
+ <form local-class =" search-form" action =' /search' role =" search" {{ on " submit" (prevent-default this.search )}} data-test-search-form>
9
9
{{! template-lint-disable require-input-label}}
10
10
{{! disabled due to https://github.com/ember-template-lint/ember-template-lint/issues/2141 }}
11
11
<input
12
12
type =" text"
13
- local-class =" search"
13
+ local-class =" search-input-lg "
14
14
name =" q"
15
15
id =" cargo-desktop-search"
16
16
placeholder =" Click or press 'S' to search..."
24
24
aria-label =" Search"
25
25
data-test-search-input
26
26
>
27
+
28
+ {{! Second input fields for narrow screens because CSS does not allow us to change the placeholder }}
29
+ <input
30
+ type =" text"
31
+ local-class =" search-input-sm"
32
+ name =" q"
33
+ placeholder =" Search"
34
+ value ={{ this.header.searchValue }}
35
+ oninput ={{ this.updateSearchValue }}
36
+ autocorrect =" off"
37
+ required
38
+ aria-label =" Search"
39
+ >
40
+
41
+ {{! Hidden submit button to enable enter-to-submit behavior for form with multiple inputs }}
42
+ <button type =" submit" local-class =" submit-button" >Submit</button >
43
+
27
44
{{ on-key ' s' (focus ' #cargo-desktop-search' )}}
28
45
{{ on-key ' S' (focus ' #cargo-desktop-search' )}}
29
46
{{ on-key ' shift+s' (focus ' #cargo-desktop-search' )}}
144
161
</dd .Menu>
145
162
</Dropdown >
146
163
</div >
147
-
148
- <form local-class =' mobile-search' action =' /search' role =" search" {{ on " submit" (prevent-default this.search )}} >
149
- <input
150
- type =" text"
151
- local-class =" search"
152
- name =" q"
153
- placeholder =" Search"
154
- value ={{ this.header.searchValue }}
155
- oninput ={{ this.updateSearchValue }}
156
- autocorrect =" off"
157
- required
158
- aria-label =" Search"
159
- >
160
- </form >
161
164
</div >
162
165
</header >
Original file line number Diff line number Diff line change 50
50
margin-right : 10px ;
51
51
}
52
52
53
- .desktop- search-form {
53
+ .search-form {
54
54
grid-area : search;
55
55
display : flex;
56
- flex-grow : 1 ;
57
-
58
- @media only screen and (max-width : 820px ) {
59
- display : none;
60
- }
61
56
}
62
57
63
- input .search {
58
+ .search-input {
64
59
font-size : 90% ;
65
60
border : none;
66
61
color : black;
@@ -83,20 +78,28 @@ input.search {
83
78
}
84
79
}
85
80
86
- .mobile-search {
87
- display : none;
88
- grid-area : search;
89
- margin : 0 10px 10px ;
81
+ .search-input-lg {
82
+ composes : search-input;
90
83
91
- input . search {
92
- margin : 0 ;
84
+ @media only screen and ( max-width : 820 px ) {
85
+ display : none ;
93
86
}
87
+ }
88
+
89
+ .search-input-sm {
90
+ composes : search-input;
91
+ display : none;
92
+ margin : 0 10px 10px ;
94
93
95
94
@media only screen and (max-width : 820px ) {
96
- display : block ;
95
+ display : unset ;
97
96
}
98
97
}
99
98
99
+ .submit-button {
100
+ display : none;
101
+ }
102
+
100
103
.sep {
101
104
margin : 0 10px ;
102
105
color : var (--separator-color );
You can’t perform that action at this time.
0 commit comments