Skip to content

Commit 46929c8

Browse files
committed
Fix command component accessibility issues
1 parent fb58a05 commit 46929c8

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## [Unreleased]
2+
- Fix command component accessibility issues
23

34
## 2.0.2 - 2025-08-06
45
- Introduce surface color for component backgrounds

lib/generators/css_zero/add/templates/app/javascript/controllers/command_controller.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,13 @@ export default class extends Controller {
1212

1313
connect() {
1414
this.combobox = new Combobox(this.inputTarget, this.listTarget, { firstOptionSelectionMode: "selected" })
15+
this.combobox.start()
1516
}
1617

1718
disconnect() {
1819
this.combobox.destroy()
1920
}
2021

21-
start() {
22-
this.combobox.start()
23-
}
24-
25-
stop() {
26-
this.combobox.stop()
27-
}
28-
2922
filter({ target }) {
3023
this.#reset()
3124

@@ -37,6 +30,10 @@ export default class extends Controller {
3730
}
3831
}
3932

33+
commit({ target }) {
34+
Turbo.visit(target.dataset.href, { action: "advance" })
35+
}
36+
4037
#reset() {
4138
this.listTarget.querySelectorAll(`.${this.selectedClass}`).forEach(it => {
4239
it.classList.remove(this.selectedClass)

0 commit comments

Comments
 (0)