From 36ab7ff2a95d6ffa823e0949e87cdb3cb44b4300 Mon Sep 17 00:00:00 2001 From: Kris Date: Thu, 9 Nov 2023 18:05:02 -0500 Subject: [PATCH] FIX: update tag-chooser & category-selector action (#24318) --- .../select-kit/addon/components/category-selector.js | 4 +--- .../javascripts/select-kit/addon/components/tag-chooser.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/select-kit/addon/components/category-selector.js b/app/assets/javascripts/select-kit/addon/components/category-selector.js index a2fc25223af..ede830289f4 100644 --- a/app/assets/javascripts/select-kit/addon/components/category-selector.js +++ b/app/assets/javascripts/select-kit/addon/components/category-selector.js @@ -94,9 +94,7 @@ export default MultiSelectComponent.extend({ actions: { onChange(values) { - this.attrs.onChange( - values.map((v) => Category.findById(v)).filter(Boolean) - ); + this.onChange(values.map((v) => Category.findById(v)).filter(Boolean)); return false; }, }, diff --git a/app/assets/javascripts/select-kit/addon/components/tag-chooser.js b/app/assets/javascripts/select-kit/addon/components/tag-chooser.js index ab02f7ada7f..ae3bfceee2f 100644 --- a/app/assets/javascripts/select-kit/addon/components/tag-chooser.js +++ b/app/assets/javascripts/select-kit/addon/components/tag-chooser.js @@ -71,8 +71,8 @@ export default MultiSelectComponent.extend(TagsMixin, { actions: { onChange(value, items) { - if (this.attrs.onChange) { - this.attrs.onChange(value, items); + if (this.onChange) { + this.onChange(value, items); } else { this.set("tags", value); }