Closed janpeterka closed 4 months ago
Describe the bug Choices.js doesn't work for me at all, getting TypeError: A is undefined error.
TypeError: A is undefined
I'm trying to use Choices.js for the first time, so possibly I'm missing something simple here.
Having Rails 7.1 app, this is how I tried to use Choices:
importmaps
# config/importmap.rb
pin "choices" # @0.1.3 pin "colors" # @0.6.2 pin "process" # @2.0.1
2. Created Stimulus controller: ```js import { Controller } from "@hotwired/stimulus" import Choices from "choices" export default class extends Controller { connect() { const element = document.querySelector('.selectize'); const choices = new Choices(element) } }
= form.association :assignees, multiple: true, label: false, collection: task_group.group.members, col_span: :full, input_html: {class: "selectize", data: {controller: "select"}}
(Later i tried on simple select element, getting same result)
select
Desktop (please complete the following information):
Browser - Firefox 122
Thanks for help, I'd really like to give Choices a try!
Right after I posted this, I noticed that pinned version is weird, and I'm using wrong package the whole time :facepalm:
Describe the bug Choices.js doesn't work for me at all, getting
TypeError: A is undefined
error.I'm trying to use Choices.js for the first time, so possibly I'm missing something simple here.
Having Rails 7.1 app, this is how I tried to use Choices:
importmaps
:pin "choices" # @0.1.3 pin "colors" # @0.6.2 pin "process" # @2.0.1
(Later i tried on simple
select
element, getting same result)Desktop (please complete the following information):
Browser - Firefox 122
Thanks for help, I'd really like to give Choices a try!