Skip to content

Commit

Permalink
fix(Timepicker): can not clear when panel has opened, close #192
Browse files Browse the repository at this point in the history
  • Loading branch information
Javey committed Jan 17, 2019
1 parent d0bb9cb commit 7e2a5d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/datepicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ export default class Datepicker extends Intact {

const {begin, end} = this.refs;
// if cancel all selected value of range, the length of v is 0
const length = v.length;
if (v && length) {
if (v && v.length) {
const length = v.length;
if (length === 2) {
// select the first begin/end date
value = v.slice(0);
} else {
// select or re-select
const last = v[v.length - 1];
const last = v[length - 1];
value = [last];
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/react.demos.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('React Demos', () => {
let demo;

afterEach(() => {
// unmount(demo);
unmount(demo);
});

function wrap(Demo) {
Expand Down

0 comments on commit 7e2a5d8

Please sign in to comment.