Skip to content

Instantly share code, notes, and snippets.

@existentialmutt
Created June 16, 2021 03:22
Show Gist options
  • Select an option

  • Save existentialmutt/4955e1a7480e5ff087fe33e88743417c to your computer and use it in GitHub Desktop.

Select an option

Save existentialmutt/4955e1a7480e5ff087fe33e88743417c to your computer and use it in GitHub Desktop.

Revisions

  1. existentialmutt created this gist Jun 16, 2021.
    15 changes: 15 additions & 0 deletions slim_select_controller.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    import { Controller } from "stimulus";
    import SlimSelect from "slim-select";

    export default class extends Controller {
    connect() {
    this.slimSelect = new SlimSelect({
    select: this.element,
    addToBody: true
    });
    }

    disconnect() {
    this.slimSelect.destroy();
    }
    }