From dd21a78efafb376787d7325f5f16deff7397a91e Mon Sep 17 00:00:00 2001 From: aaronfulkerson <31112737+aaronfulkerson@users.noreply.github.com> Date: Fri, 8 Mar 2019 20:42:11 -0800 Subject: [PATCH 1/2] Select: set value to null when cleared (#14322) --- packages/select/src/select.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/select/src/select.vue b/packages/select/src/select.vue index 907bd4d4e58..b86d3c206da 100644 --- a/packages/select/src/select.vue +++ b/packages/select/src/select.vue @@ -742,7 +742,7 @@ deleteSelected(event) { event.stopPropagation(); - const value = this.multiple ? [] : ''; + const value = this.multiple ? [] : null; this.$emit('input', value); this.emitChange(value); this.visible = false; From 6154fa273f541f88947783559f7ed95aa2ad5bd2 Mon Sep 17 00:00:00 2001 From: aaronfulkerson <31112737+aaronfulkerson@users.noreply.github.com> Date: Fri, 8 Mar 2019 20:55:21 -0800 Subject: [PATCH 2/2] Select: update tests for clearable (#14322) --- test/unit/specs/select.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/specs/select.spec.js b/test/unit/specs/select.spec.js index cb1898ab950..264ed066723 100644 --- a/test/unit/specs/select.spec.js +++ b/test/unit/specs/select.spec.js @@ -288,7 +288,7 @@ describe('Select', () => { const iconClear = vm.$el.querySelector('.el-input__icon.el-icon-circle-close'); expect(iconClear).to.exist; iconClear.click(); - expect(vm.value).to.equal(''); + expect(vm.value).to.equal(null); done(); }, 100); });