Skip to content

Commit

Permalink
feat(component): default to type="text" on <TextInput> (#1206)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
tulup-conner committed Jan 1, 2024
1 parent 8e0b658 commit fbd57c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
shadow,
sizing = 'md',
theme: customTheme = {},
type = 'text',
...props
},
ref,
Expand Down Expand Up @@ -95,6 +96,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
theme.field.input.withAddon[addon ? 'on' : 'off'],
theme.field.input.withShadow[shadow ? 'on' : 'off'],
)}
type={type}
{...props}
ref={ref}
/>
Expand Down

1 comment on commit fbd57c8

@vercel
Copy link

@vercel vercel bot commented on fbd57c8 Jan 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.