FIX: improves and fixes a regression with category-selector (#9821)

FIX: improves and fixes a regression with category-selector (#9821)

diff --git a/app/assets/javascripts/select-kit/app/components/category-selector.js b/app/assets/javascripts/select-kit/app/components/category-selector.js
index 20475d7..96ee7c0 100644
--- a/app/assets/javascripts/select-kit/app/components/category-selector.js
+++ b/app/assets/javascripts/select-kit/app/components/category-selector.js
@@ -43,6 +43,10 @@ export default MultiSelectComponent.extend({
     );
   },
 
+  modifyComponentForRow() {
+    return "category-row";
+  },
+
   actions: {
     onChange(values) {
       this.attrs.onChange(
diff --git a/app/assets/javascripts/select-kit/app/templates/components/multi-select/selected-category.hbs b/app/assets/javascripts/select-kit/app/templates/components/multi-select/selected-category.hbs
index dd72918..5d35d2b 100644
--- a/app/assets/javascripts/select-kit/app/templates/components/multi-select/selected-category.hbs
+++ b/app/assets/javascripts/select-kit/app/templates/components/multi-select/selected-category.hbs
@@ -1,4 +1,6 @@
-<div class="body">
-  {{badge}}
-  {{d-icon "times"}}
+<div {{action "onSelectedNameClick"}} tabindex="0" title={{title}} data-value={{value}} data-name={{name}} class="select-kit-selected-name selected-name choice">
+  <div class="body">
+    {{badge}}
+    {{d-icon "times"}}
+  </div>
 </div>
diff --git a/app/assets/stylesheets/common/select-kit/category-selector.scss b/app/assets/stylesheets/common/select-kit/category-selector.scss
index 0f2ba6c..972be8b 100644
--- a/app/assets/stylesheets/common/select-kit/category-selector.scss
+++ b/app/assets/stylesheets/common/select-kit/category-selector.scss
@@ -9,5 +9,13 @@
         }
       }
     }
+
+    .category-row {
+      max-width: 100%;
+
+      .topic-count {
+        margin-left: 0.25em;
+      }
+    }
   }
 }

GitHub sha: cfad3818

1 Like

This commit appears in #9821 which was merged by jjaffeux.