From 4f834f0008ca424b85e13b42816e920457605c3d Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 21 Apr 2020 16:20:05 +0200 Subject: [PATCH] DEV: allows click to propagate outside of header but not outside of sk (#9491) --- app/assets/javascripts/select-kit/components/select-kit.js | 4 ++++ .../select-kit/components/select-kit/select-kit-header.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/select-kit/components/select-kit.js b/app/assets/javascripts/select-kit/components/select-kit.js index 828ee6c7654..7898179be01 100644 --- a/app/assets/javascripts/select-kit/components/select-kit.js +++ b/app/assets/javascripts/select-kit/components/select-kit.js @@ -122,6 +122,10 @@ export default Component.extend( ); }, + click(event) { + event.stopPropagation(); + }, + _modifyComponentForRowWrapper(collection, item) { let component = this.modifyComponentForRow(collection, item); return component || "select-kit/select-kit-row"; diff --git a/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js b/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js index 6ec3984a98e..61f57d1b5db 100644 --- a/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js +++ b/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js @@ -13,7 +13,7 @@ export default Component.extend(UtilsMixin, { return; if (this.eventType !== "click" || event.button !== 0) return; this.selectKit.toggle(event); - return false; + event.preventDefault(); }, classNames: ["select-kit-header"],