From 28dbdd17ed5b7278b4a0415b87c7fc304cf37981 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 17 Feb 2017 14:09:27 +0800 Subject: [PATCH] fix for #4920 --- components/date-picker/RangePicker.tsx | 2 +- .../date-picker/__tests__/__snapshots__/demo.test.js.snap | 6 +++--- components/form/__tests__/__snapshots__/demo.test.js.snap | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/date-picker/RangePicker.tsx b/components/date-picker/RangePicker.tsx index 5ce2cf9ed7..85ed4a02f0 100644 --- a/components/date-picker/RangePicker.tsx +++ b/components/date-picker/RangePicker.tsx @@ -165,7 +165,7 @@ export default class RangePicker extends React.Component { // default width for showTime const pickerStyle = {} as any; if (props.showTime) { - pickerStyle.width = style.width || 300; + pickerStyle.width = (style && style.width) || 300; } const clearIcon = (!props.disabled && props.allowClear && value && (value[0] || value[1])) diff --git a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap index de0f789ca9..084dfc4398 100644 --- a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap @@ -127,7 +127,7 @@ exports[`test renders ./components/date-picker/demo/disabled-date.md correctly 1
+ style="width:300px;"> + style="width:300px;"> + style="width:300px;"> + style="width:300px;">