Skip to content

Commit bbfdc74

Browse files
committed
crates: Fix "missing label element" warning
1 parent 51afa2f commit bbfdc74

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

app/styles/crates.module.css

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,28 @@
1616
a:hover { background-color: var(--main-bg-dark); }
1717
a:global(.active) { background-color: var(--main-bg-dark); }
1818

19-
select {
20-
display: none;
21-
width: 100%;
22-
padding: 5px;
23-
}
24-
2519
@media only screen and (max-width: 650px) {
2620
padding: 0;
2721
background-color: inherit;
2822
a { display: none; }
29-
select { display: block; }
3023
}
3124
}
3225

26+
.filter-dropdown-label {
27+
display: none;
28+
29+
@media only screen and (max-width: 650px) {
30+
display: flex;
31+
align-items: center;
32+
width: 100%;
33+
}
34+
}
35+
36+
.filter-dropdown {
37+
flex-grow: 1;
38+
margin-left: 20px;
39+
}
40+
3341
.results-meta {
3442
display: flex;
3543
align-items: center;

app/templates/crates.hbs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99
</LinkTo>
1010
{{/each}}
1111

12-
<select {{on "change" this.handleSelection}}>
13-
<option>Filter by the letter...</option>
14-
{{#each this.alphabet as |letter|}}
15-
<option value={{letter}} selected={{eq letter this.letter}}>{{ letter }}</option>
16-
{{/each}}
17-
</select>
12+
<label local-class="filter-dropdown-label">
13+
Filter by letter:
14+
15+
<select local-class="filter-dropdown" {{on "change" this.handleSelection}}>
16+
<option value="">No Filter</option>
17+
{{#each this.alphabet as |letter|}}
18+
<option value={{letter}} selected={{eq letter this.letter}}>{{ letter }}</option>
19+
{{/each}}
20+
</select>
21+
</label>
1822
</div>
1923

2024
<div local-class="results-meta">

0 commit comments

Comments
 (0)