support name prop (#15029)

This commit is contained in:
zombieJ 2019-02-25 11:28:31 +08:00 committed by GitHub
parent 94814d955f
commit fb6a493f11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,11 @@ describe('DatePicker', () => {
MockDate.reset();
});
it('support name prop', () => {
const wrapper = mount(<DatePicker name="bamboo" />);
expect(wrapper.find('input').props().name).toBe('bamboo');
});
it('prop locale should works', () => {
const locale = {
lang: {

View File

@ -230,6 +230,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
placeholder={placeholder}
className={props.pickerInputClass}
tabIndex={props.tabIndex}
name={props.name}
{...dataOrAriaProps}
/>
{clearIcon}

View File

@ -4,6 +4,7 @@ import { TimePickerProps } from '../time-picker';
export interface PickerProps {
id?: number | string;
name?: string;
prefixCls?: string;
inputPrefixCls?: string;
format?: string | string[];