Skip to content

A platform for community discussion. Free, open, simple.

DEV: allows a sk component to stop click propagation (#9495)

Joffrey JAFFEUX62459c845f1b
diff --git a/app/assets/javascripts/select-kit/components/select-kit.js b/app/assets/javascripts/select-kit/components/select-kit.js
index a98687caab2..4fdbd629286 100644
--- a/app/assets/javascripts/select-kit/components/select-kit.js
+++ b/app/assets/javascripts/select-kit/components/select-kit.js
@@ -123,7 +123,9 @@ export default Component.extend(
},
click(event) {
- event.stopPropagation();
+ if (this.selectKit.options.preventsClickPropagation) {
+ event.stopPropagation();
+ }
},
_modifyComponentForRowWrapper(collection, item) {
@@ -270,7 +272,8 @@ export default Component.extend(
placementStrategy: null,
filterComponent: "select-kit/select-kit-filter",
selectedNameComponent: "selected-name",
- castInteger: false
+ castInteger: false,
+ preventsClickPropagation: false
},
autoFilterable: computed("content.[]", "selectKit.filter", function() {
diff --git a/app/assets/javascripts/select-kit/templates/components/topic-notifications-button.hbs b/app/assets/javascripts/select-kit/templates/components/topic-notifications-button.hbs
index a57b6b85845..b111dd6a58b 100644
--- a/app/assets/javascripts/select-kit/templates/components/topic-notifications-button.hbs
+++ b/app/assets/javascripts/select-kit/templates/components/topic-notifications-button.hbs
@@ -5,6 +5,7 @@
options=(hash
showFullTitle=showFullTitle
placement=placement
+ preventsClickPropagation=true
)
}}