Skip to content

Commit fbd57c8

Browse files
authored
feat(component): default to type="text" on <TextInput> (#1206)
All of the other form components provide an implicit `type=".."` field so this one should, too. It is implied by the name that this will be an `<input type="text">` by default, and you have the *option* to provide a specific other `type`.
1 parent 8e0b658 commit fbd57c8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/TextInput/TextInput.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
6464
shadow,
6565
sizing = 'md',
6666
theme: customTheme = {},
67+
type = 'text',
6768
...props
6869
},
6970
ref,
@@ -95,6 +96,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
9596
theme.field.input.withAddon[addon ? 'on' : 'off'],
9697
theme.field.input.withShadow[shadow ? 'on' : 'off'],
9798
)}
99+
type={type}
98100
{...props}
99101
ref={ref}
100102
/>

0 commit comments

Comments
 (0)