From 64c154d9df19371bc80884a7903c4d48b43d3293 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 13 Sep 2017 10:00:10 +0200 Subject: [PATCH] FIX: prevents click on select-box to close timeline-container on mobile --- .../components/dropdown-select-box/dropdown-header.js.es6 | 2 +- app/assets/javascripts/discourse/components/select-box.js.es6 | 4 ++++ .../discourse/components/select-box/select-box-header.js.es6 | 3 ++- .../stylesheets/common/components/dropdown-select-box.scss | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/components/dropdown-select-box/dropdown-header.js.es6 b/app/assets/javascripts/discourse/components/dropdown-select-box/dropdown-header.js.es6 index b5ec32600f1..9e6499c04f2 100644 --- a/app/assets/javascripts/discourse/components/dropdown-select-box/dropdown-header.js.es6 +++ b/app/assets/javascripts/discourse/components/dropdown-select-box/dropdown-header.js.es6 @@ -3,5 +3,5 @@ import SelectBoxHeaderComponent from "discourse/components/select-box/select-box export default SelectBoxHeaderComponent.extend({ layoutName: "components/dropdown-select-box/dropdown-header", - classNames: ["dropdown-header"], + classNames: ["dropdown-header"] }); diff --git a/app/assets/javascripts/discourse/components/select-box.js.es6 b/app/assets/javascripts/discourse/components/select-box.js.es6 index e3483750a02..612e21039da 100644 --- a/app/assets/javascripts/discourse/components/select-box.js.es6 +++ b/app/assets/javascripts/discourse/components/select-box.js.es6 @@ -49,6 +49,10 @@ export default Ember.Component.extend({ castInteger: false, + click(event) { + event.stopPropagation(); + }, + filterFunction: function(content) { return (selectBox) => { const filter = selectBox.get("filter").toLowerCase(); diff --git a/app/assets/javascripts/discourse/components/select-box/select-box-header.js.es6 b/app/assets/javascripts/discourse/components/select-box/select-box-header.js.es6 index 57d5f066ab1..033af31237f 100644 --- a/app/assets/javascripts/discourse/components/select-box/select-box-header.js.es6 +++ b/app/assets/javascripts/discourse/components/select-box/select-box-header.js.es6 @@ -9,8 +9,9 @@ export default Ember.Component.extend({ this._setCaretIcon(); }, - click() { + click(event) { this.sendAction("onToggle"); + event.stopPropagation(); }, _setCaretIcon() { diff --git a/app/assets/stylesheets/common/components/dropdown-select-box.scss b/app/assets/stylesheets/common/components/dropdown-select-box.scss index 385a0936bc6..86918865468 100644 --- a/app/assets/stylesheets/common/components/dropdown-select-box.scss +++ b/app/assets/stylesheets/common/components/dropdown-select-box.scss @@ -55,6 +55,7 @@ display: block; font-size: 1em; color: $primary; + padding: 0; } .desc {