From 52580605d893c814c5af2001731a84890a70537d Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 4 Jun 2020 21:33:57 +0800 Subject: [PATCH] FIX: select-kit components not being hidden. --- .../select-kit/addon/templates/components/multi-select.hbs | 2 +- .../select-kit/addon/templates/components/single-select.hbs | 2 +- app/assets/stylesheets/common/select-kit/select-kit.scss | 4 ---- test/javascripts/acceptance/composer-actions-test.js | 1 + 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/select-kit/addon/templates/components/multi-select.hbs b/app/assets/javascripts/select-kit/addon/templates/components/multi-select.hbs index e0d1f54f00f..5c7b93adf0c 100644 --- a/app/assets/javascripts/select-kit/addon/templates/components/multi-select.hbs +++ b/app/assets/javascripts/select-kit/addon/templates/components/multi-select.hbs @@ -1,4 +1,4 @@ -{{#unless isHidden}} +{{#unless selectKit.isHidden}} {{component selectKit.options.headerComponent tabindex=tabindex value=value diff --git a/app/assets/javascripts/select-kit/addon/templates/components/single-select.hbs b/app/assets/javascripts/select-kit/addon/templates/components/single-select.hbs index a3b71cba23d..7fac16c9f52 100644 --- a/app/assets/javascripts/select-kit/addon/templates/components/single-select.hbs +++ b/app/assets/javascripts/select-kit/addon/templates/components/single-select.hbs @@ -1,4 +1,4 @@ -{{#unless isHidden}} +{{#unless selectKit.isHidden}} {{component selectKit.options.headerComponent tabindex=tabindex value=value diff --git a/app/assets/stylesheets/common/select-kit/select-kit.scss b/app/assets/stylesheets/common/select-kit/select-kit.scss index 4080d1db95d..887974b7121 100644 --- a/app/assets/stylesheets/common/select-kit/select-kit.scss +++ b/app/assets/stylesheets/common/select-kit/select-kit.scss @@ -7,10 +7,6 @@ vertical-align: middle; user-select: none; - &.is-hidden { - display: none !important; - } - &.is-disabled { pointer-events: none; } diff --git a/test/javascripts/acceptance/composer-actions-test.js b/test/javascripts/acceptance/composer-actions-test.js index f421ec41b13..2ee96e3af9e 100644 --- a/test/javascripts/acceptance/composer-actions-test.js +++ b/test/javascripts/acceptance/composer-actions-test.js @@ -177,6 +177,7 @@ QUnit.test("hide component if no content", async assert => { await composerActions.selectRowByValue("reply_as_private_message"); assert.ok(composerActions.el().hasClass("is-hidden")); + assert.equal(composerActions.el().children().length, 0); await click("button#create-topic"); await composerActions.expand();