diff --git a/app/components/select_input_component/select_input_component_controller.js b/app/components/select_input_component/select_input_component_controller.js index 45c50a4d46..5002e90ea5 100644 --- a/app/components/select_input_component/select_input_component_controller.js +++ b/app/components/select_input_component/select_input_component_controller.js @@ -2,12 +2,16 @@ import { Controller } from "@hotwired/stimulus" import TomSelect from "tom-select" export default class extends Controller { + static values = { + multiple: Boolean, + openAdd : Boolean + } connect() { let myOptions = {} - if (this.data.get("multipleValue")) { + if (this.multipleValue) { myOptions['plugins'] = ['remove_button']; } - if (this.data.get("openAddValue")) { + if (this.openAddValue) { myOptions['create'] = true; } new TomSelect(this.element, myOptions);