From 2ff2c4990860a2673adf41c015ceba7a9f625227 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 17 Sep 2018 22:14:41 +0200 Subject: [PATCH] Revert "FIX: ensures onSelect/onDeselect are called" This reverts commit 52eed7329429abffefb7df7aac469e188a0ae298. --- .../components/single-select.js.es6 | 4 -- .../components/single-select-test.js.es6 | 52 ------------------- 2 files changed, 56 deletions(-) diff --git a/app/assets/javascripts/select-kit/components/single-select.js.es6 b/app/assets/javascripts/select-kit/components/single-select.js.es6 index af3aa3a4f8d..7713d51194b 100644 --- a/app/assets/javascripts/select-kit/components/single-select.js.es6 +++ b/app/assets/javascripts/select-kit/components/single-select.js.es6 @@ -210,10 +210,6 @@ export default SelectKitComponent.extend({ }, select(computedContentItem) { - if (this.get("hasSelection")) { - this.deselect(this.get("selection.value")); - } - if ( !computedContentItem || computedContentItem.__sk_row_type === "noneRow" diff --git a/test/javascripts/components/single-select-test.js.es6 b/test/javascripts/components/single-select-test.js.es6 index 72366fdf72e..439781e202e 100644 --- a/test/javascripts/components/single-select-test.js.es6 +++ b/test/javascripts/components/single-select-test.js.es6 @@ -835,55 +835,3 @@ componentTest("without forceEscape", { ); } }); - -componentTest("onSelect", { - template: - "
{{single-select content=content onSelect=(action externalAction)}}", - - beforeEach() { - this.set("externalAction", actual => { - find(".test-external-action").text(actual); - }); - - this.set("content", ["red", "blue"]); - }, - - async test(assert) { - await this.get("subject").expand(); - await this.get("subject").selectRowByValue("red"); - - assert.equal( - find(".test-external-action") - .text() - .trim(), - "red" - ); - } -}); - -componentTest("onDeselect", { - template: - "
{{single-select content=content onDeselect=(action externalAction)}}", - - beforeEach() { - this.set("externalAction", actual => { - find(".test-external-action").text(actual); - }); - - this.set("content", ["red", "blue"]); - }, - - async test(assert) { - await this.get("subject").expand(); - await this.get("subject").selectRowByValue("red"); - await this.get("subject").expand(); - await this.get("subject").selectRowByValue("blue"); - - assert.equal( - find(".test-external-action") - .text() - .trim(), - "red" - ); - } -});