From 3f3f32b3bef849c6eb14c71595892e5e62d138e1 Mon Sep 17 00:00:00 2001 From: Kate605690919 <229026@whut.edu.cn> Date: Mon, 16 Dec 2019 10:35:53 +0800 Subject: [PATCH] =?UTF-8?q?date=E5=BF=AB=E6=8D=B7=E9=94=AE=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scss/components/form/_date.scss | 5 ++++- src/components/DatePicker.tsx | 5 +++-- src/components/DateRangePicker.tsx | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scss/components/form/_date.scss b/scss/components/form/_date.scss index dc9797976..d863414ad 100644 --- a/scss/components/form/_date.scss +++ b/scss/components/form/_date.scss @@ -83,10 +83,13 @@ } .#{$ns}DatePicker-shortcuts { - margin: $gap-sm $gap-md (-$gap-sm) $gap-md; + margin: $gap-sm $gap-md $gap-sm $gap-md; padding: 0; list-style: none; max-width: 206px; + & + .rdt .rdtPicker { + padding-top: 0; + } } .#{$ns}DatePicker-shortcut { diff --git a/src/components/DatePicker.tsx b/src/components/DatePicker.tsx index dd257f694..59de795ae 100644 --- a/src/components/DatePicker.tsx +++ b/src/components/DatePicker.tsx @@ -845,6 +845,7 @@ export class DatePicker extends React.Component { this.getParent = this.getParent.bind(this); this.getTarget = this.getTarget.bind(this); this.handlePopOverClick = this.handlePopOverClick.bind(this); + this.renderShortCuts = this.renderShortCuts.bind(this); } dom: HTMLDivElement; @@ -994,7 +995,7 @@ export class DatePicker extends React.Component { return null; } - renderShortCuts = (shortcuts: string | Array) => { + renderShortCuts(shortcuts: string | Array) { if (!shortcuts) { return null; } @@ -1033,7 +1034,7 @@ export class DatePicker extends React.Component { })} ); - }; + } render() { const { diff --git a/src/components/DateRangePicker.tsx b/src/components/DateRangePicker.tsx index 33b2a0ec8..93307e83a 100644 --- a/src/components/DateRangePicker.tsx +++ b/src/components/DateRangePicker.tsx @@ -235,7 +235,7 @@ export class DateRangePicker extends React.Component< this.handleClick = this.handleClick.bind(this); this.handleKeyPress = this.handleKeyPress.bind(this); this.handlePopOverClick = this.handlePopOverClick.bind(this); - + this.renderRanges = this.renderRanges.bind(this); const {format, joinValues, delimiter, value} = this.props; this.state = { @@ -363,7 +363,7 @@ export class DateRangePicker extends React.Component< }); } - renderRanges = (ranges: string | Array | undefined) => { + renderRanges(ranges: string | Array | undefined) { if (!ranges) { return null; } @@ -403,7 +403,7 @@ export class DateRangePicker extends React.Component< })} ); - }; + } clearValue(e: React.MouseEvent) { e.preventDefault();