Pass id prop to DatePicker input field (#8598)

This commit is contained in:
mgrdevport 2018-01-24 03:45:46 +01:00 committed by Wei Zhu
parent b7901e541a
commit cfdb1cab4b
5 changed files with 9 additions and 1 deletions

View File

@ -301,6 +301,7 @@ export default class RangePicker extends React.Component<any, RangePickerState>
return (
<span
ref={this.savePicker}
id={props.id}
className={classNames(props.className, props.pickerClass)}
style={{ ...style, ...pickerStyle }}
tabIndex={props.disabled ? -1 : 0}

View File

@ -131,7 +131,7 @@ export default class WeekPicker extends React.Component<any, any> {
);
};
return (
<span className={classNames(className, pickerClass)}>
<span className={classNames(className, pickerClass)} id={this.props.id}>
<RcDatePicker
{...this.props}
calendar={calendar}

View File

@ -162,6 +162,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
}
return (
<span
id={props.id}
className={classNames(props.className, props.pickerClass)}
style={props.style}
onFocus={props.onFocus}

View File

@ -3,6 +3,7 @@ import * as moment from 'moment';
import { TimePickerProps } from '../time-picker';
export interface PickerProps {
id?: number | string;
prefixCls?: string;
inputPrefixCls?: string;
format?: string;

View File

@ -1720,6 +1720,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
>
<span
class="ant-calendar-picker"
id="date-picker"
>
<div>
<input
@ -1758,6 +1759,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
>
<span
class="ant-calendar-picker"
id="date-time-picker"
>
<div>
<input
@ -1796,6 +1798,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
>
<span
class="ant-calendar-picker"
id="month-picker"
>
<div>
<input
@ -1834,6 +1837,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
>
<span
class="ant-calendar-picker"
id="range-picker"
tabindex="0"
>
<span
@ -1888,6 +1892,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
>
<span
class="ant-calendar-picker"
id="range-time-picker"
style="width:350px"
tabindex="0"
>