Skip to content

Instantly share code, notes, and snippets.

@shavin-peiries
Created November 2, 2021 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shavin-peiries/e1d2ac7a70fb0225c6001ecf3226db29 to your computer and use it in GitHub Desktop.
Save shavin-peiries/e1d2ac7a70fb0225c6001ecf3226db29 to your computer and use it in GitHub Desktop.
Stimulus Controller for slim-select.js
import { Controller } from '@hotwired/stimulus'
import SlimSelect from 'slim-select'
export default class extends Controller {
connect() {
this.slimselect = new SlimSelect({
select: this.element,
hideSelectedOption: false
})
}
disconnect() {
this.slimselect.destroy()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment