Browse Source

DatePicker: Fix Typing a date and tabbing does not close the calendar #4948 (#5149)

* DatePicker: Fix Typing a date and tabbing does not close the calendar #4948

* DatePicker: Fix Typing a date and tabbing does not close the calendar #4948 -Updated test case
ChuckFields 8 years ago
parent
commit
66cad95a4b
2 changed files with 2 additions and 2 deletions
  1. 1 1
      packages/date-picker/src/panel/date.vue
  2. 1 1
      test/unit/specs/date-picker.spec.js

+ 1 - 1
packages/date-picker/src/panel/date.vue

@@ -161,7 +161,7 @@
           this.date = newVal;
           this.year = newVal.getFullYear();
           this.month = newVal.getMonth();
-          this.$emit('pick', newVal, true);
+          this.$emit('pick', newVal, false);
         }
       },
 

+ 1 - 1
test/unit/specs/date-picker.spec.js

@@ -385,7 +385,7 @@ describe('DatePicker', () => {
       input.value = '2000-10-1';
       triggerEvent(input, 'change', true);
       setTimeout(_ => {
-        expect(vm.pickerVisible).to.true; // 敲回车不会消失
+        expect(vm.pickerVisible).to.false;
         expect(vm.picker.date.getFullYear()).to.equal(2000);
         expect(vm.picker.date.getMonth()).to.equal(9);
         expect(vm.picker.date.getDate()).to.equal(1);