Skip to content

Commit 68ab716

Browse files
authored
Allow autoComplete attribute to be customized (#472)
* Allow `autoComplete` attribute to be customized * add autoComplete to InputProps interface * fix ci
1 parent d795e2e commit 68ab716

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/Selector/Input.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface InputProps {
99
inputElement: React.ReactElement;
1010
disabled: boolean;
1111
autoFocus: boolean;
12+
autoComplete: string;
1213
editable: boolean;
1314
accessibilityIndex: number;
1415
value: string;
@@ -28,6 +29,7 @@ const Input: React.RefForwardingComponent<InputRef, InputProps> = (
2829
disabled,
2930
tabIndex,
3031
autoFocus,
32+
autoComplete,
3133
editable,
3234
accessibilityIndex,
3335
value,
@@ -55,7 +57,7 @@ const Input: React.RefForwardingComponent<InputRef, InputProps> = (
5557
ref: composeRef(ref, originRef as any),
5658
disabled,
5759
tabIndex,
58-
autoComplete: 'off',
60+
autoComplete: autoComplete || 'off',
5961
autoFocus,
6062
className: `${prefixCls}-selection-search-input`,
6163
style: { ...style, opacity: editable ? null : 0 },

src/Selector/MultipleSelector.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const SelectSelector: React.FC<SelectorProps> = ({
4141
mode,
4242
showSearch,
4343
autoFocus,
44+
autoComplete,
4445
accessibilityIndex,
4546
tabIndex,
4647

@@ -183,6 +184,7 @@ const SelectSelector: React.FC<SelectorProps> = ({
183184
inputElement={null}
184185
disabled={disabled}
185186
autoFocus={autoFocus}
187+
autoComplete={autoComplete}
186188
editable={inputEditable}
187189
accessibilityIndex={accessibilityIndex}
188190
value={inputValue}

src/Selector/SingleSelector.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const SingleSelector: React.FC<SelectorProps> = ({
1515
inputRef,
1616
disabled,
1717
autoFocus,
18+
autoComplete,
1819
accessibilityIndex,
1920
mode,
2021
open,
@@ -54,6 +55,7 @@ const SingleSelector: React.FC<SelectorProps> = ({
5455
inputElement={inputElement}
5556
disabled={disabled}
5657
autoFocus={autoFocus}
58+
autoComplete={autoComplete}
5759
editable={inputEditable}
5860
accessibilityIndex={accessibilityIndex}
5961
value={inputValue}

src/Selector/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface InnerSelectorProps {
2525
placeholder?: React.ReactNode;
2626
disabled?: boolean;
2727
autoFocus?: boolean;
28+
autoComplete?: string;
2829
values: LabelValueType[];
2930
showSearch?: boolean;
3031
searchValue: string;

0 commit comments

Comments
 (0)