= {};
- let open: boolean = prevState.open;
+ let { open } = prevState;
if ('open' in nextProps) {
state.open = nextProps.open;
@@ -53,6 +53,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
}
private input: any;
+
private prefixCls?: string;
constructor(props: any) {
@@ -92,7 +93,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
};
handleChange = (value: moment.Moment | null) => {
- const props = this.props;
+ const { props } = this;
if (!('value' in props)) {
this.setState({
value,
@@ -155,13 +156,13 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
let pickerProps: Object = {};
let calendarProps: any = {};
- const pickerStyle: { width?: number } = {};
+ const pickerStyle: { minWidth?: number } = {};
if (props.showTime) {
calendarProps = {
// fix https://github.com/ant-design/ant-design/issues/1902
onSelect: this.handleChange,
};
- pickerStyle.width = 195;
+ pickerStyle.minWidth = 195;
} else {
pickerProps = {
onChange: this.handleChange,
diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap
index 5819b074e8..f17c665ad4 100644
--- a/components/form/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/form/__tests__/__snapshots__/demo.test.js.snap
@@ -2550,7 +2550,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =