Skip to content

Commit

Permalink
Merge listbox_controller and filter_controller into command_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaronixon committed Jan 10, 2025
1 parent d3d6bfc commit 193393a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## [Unreleased]
- Merge listbox_controller and filter_controller into command_controller.

## [0.0.84] - 2024-01-09
- Don't hide [hidden='until-found']
Expand Down
3 changes: 1 addition & 2 deletions lib/generators/css_zero/add/resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ combobox:
- app/assets/images/select-arrow.svg
command:
- app/assets/stylesheets/command.css
- app/javascript/controllers/filter_controller.js
- app/javascript/controllers/listbox_controller.js
- app/javascript/controllers/command_controller.js
- app/assets/images/search.svg
collapsible:
- app/javascript/controllers/collapsible_controller.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
import { Controller } from "@hotwired/stimulus"
import { debounce } from "https://cdn.skypack.dev/[email protected]?min"
import Combobox from "https://cdn.skypack.dev/@github/[email protected]?min"

export default class extends Controller {
static targets = [ "list" ]
static targets = [ "input", "list" ]
static classes = [ "active", "selected" ]

initialize() {
this.filter = debounce(this.filter.bind(this), 300)
}

connect() {
this.combobox = new Combobox(this.inputTarget, this.listTarget)
}

disconnect() {
this.combobox.destroy()
}

start() {
this.combobox.start()
}

stop() {
this.combobox.stop()
}

filter({ target }) {
this.#reset()

Expand Down

This file was deleted.

0 comments on commit 193393a

Please sign in to comment.