Skip to content

Commit

Permalink
fix(TextInput): do not auto generate id for input if not needed (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
ref256 authored Jan 26, 2023
1 parent de0a0d5 commit 26b24df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const TextInput = React.forwardRef<HTMLSpanElement, TextInputProps>(funct
const innerControlRef = React.useRef<HTMLTextAreaElement | HTMLInputElement>(null);
const labelRef = React.useRef<HTMLLabelElement>(null);
const innerId = useUniqId();
const id = originalId || innerId;
const id = label ? originalId || innerId : originalId;
const [hasVerticalScrollbar, setHasVerticalScrollbar] = React.useState(false);

const isControlled = value !== undefined;
Expand Down

0 comments on commit 26b24df

Please sign in to comment.