From a73fd4227faf2590cada090ae75dc529c4e514f4 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 13 Oct 2020 11:31:07 +0200 Subject: [PATCH] FIX: disabled option for sk was not working correctly (#10900) Name was incorrect and it was only removing cursor events and not changing style. --- .../javascripts/select-kit/addon/components/select-kit.js | 6 ++---- app/assets/stylesheets/common/select-kit/single-select.scss | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit.js b/app/assets/javascripts/select-kit/addon/components/select-kit.js index 8931ad6259d..a89055b5894 100644 --- a/app/assets/javascripts/select-kit/addon/components/select-kit.js +++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js @@ -42,7 +42,7 @@ export default Component.extend( classNameBindings: [ "selectKit.isLoading:is-loading", "selectKit.isExpanded:is-expanded", - "selectKit.isDisabled:is-disabled", + "selectKit.options.disabled:is-disabled", "selectKit.isHidden:is-hidden", "selectKit.hasSelection:has-selection", ], @@ -178,8 +178,6 @@ export default Component.extend( didUpdateAttrs() { this._super(...arguments); - this.set("selectKit.isDisabled", this.isDisabled || false); - this.handleDeprecations(); }, @@ -985,7 +983,7 @@ export default Component.extend( allowUncategorized: "options.allowUncategorized", none: "options.none", rootNone: "options.none", - isDisabled: "options.isDisabled", + disabled: "options.disabled", rootNoneLabel: "options.none", showFullTitle: "options.showFullTitle", title: "options.translatedNone", diff --git a/app/assets/stylesheets/common/select-kit/single-select.scss b/app/assets/stylesheets/common/select-kit/single-select.scss index 8692177c1d1..edb12741609 100644 --- a/app/assets/stylesheets/common/select-kit/single-select.scss +++ b/app/assets/stylesheets/common/select-kit/single-select.scss @@ -14,4 +14,10 @@ border-color: var(--tertiary); } } + + &.is-disabled { + .select-kit-header { + opacity: 0.5; + } + } }