File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ export interface PickerSharedProps<DateType> extends React.AriaAttributes {
8282 role ?: string ;
8383 name ?: string ;
8484
85+ autoComplete ?: string ;
86+
8587 direction ?: 'ltr' | 'rtl' ;
8688}
8789
@@ -163,6 +165,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
163165 onContextMenu,
164166 onClick,
165167 direction,
168+ autoComplete,
166169 } = props as MergedPickerProps < DateType > ;
167170
168171 const inputRef = React . useRef < HTMLInputElement > ( null ) ;
@@ -469,6 +472,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
469472 { ...inputProps }
470473 size = { getInputSize ( picker , formatList [ 0 ] ) }
471474 { ...getDataOrAriaProps ( props ) }
475+ autoComplete = { autoComplete }
472476 />
473477 { suffixNode }
474478 { clearNode }
Original file line number Diff line number Diff line change @@ -504,10 +504,10 @@ describe('Picker.Basic', () => {
504504 expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
505505 } ) ;
506506
507- it ( 'support name prop' , ( ) => {
508- const wrapper = mount ( < MomentPicker name = "bamboo" /> ) ;
507+ it ( 'support name & autoComplete prop' , ( ) => {
508+ const wrapper = mount ( < MomentPicker name = "bamboo" autoComplete = "off" /> ) ;
509509
510- expect ( wrapper . find ( 'input' ) . props ( ) . name ) . toEqual ( 'bamboo' ) ;
510+ expect ( wrapper . find ( 'input' ) . props ( ) ) . toMatchObject ( { name : 'bamboo' , autoComplete : 'off' } ) ;
511511 } ) ;
512512
513513 it ( 'blur should reset invalidate text' , ( ) => {
You can’t perform that action at this time.
0 commit comments