Skip to content

Commit

Permalink
Bugfix: TextField discards type other than "text" or "password"
Browse files Browse the repository at this point in the history
  • Loading branch information
gabro committed Nov 28, 2023
1 parent a17e74a commit 4210393
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/bento-design-system/src/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export function TextField(props: Props) {
? props.hidePasswordLabel ?? defaultMessages.TextField.hidePasswordLabel
: props.showPasswordLabel ?? defaultMessages.TextField.showPasswordLabel;

const type = props.type === "password" && !showPassword ? "password" : "text";
const type = match(props.type ?? "text")
.with("password", () => (showPassword ? "text" : "password"))
.with("text", "email", "url", () => props.type)
.exhaustive();

const rightAccessory = match(props.type ?? "text")
.with("password", () => (
Expand Down

0 comments on commit 4210393

Please sign in to comment.