Skip to content

Commit

Permalink
Merge pull request #109 from aversini/fix(TextInput)-right-element-sh…
Browse files Browse the repository at this point in the history
…ould-not-be-enclosed-in-span

fix(TextInput): right element should not be enclosed in span
  • Loading branch information
aversini authored Dec 2, 2023
2 parents 4e22fe5 + a7dff91 commit 4b8804a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ui-components/src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
},
ref,
) => {
const rightElementRef = useRef<HTMLSpanElement>(null);
const rightElementRef = useRef<HTMLDivElement>(null);
const [inputPaddingRight, setInputPaddingRight] = useState(0);
const inputId = useUniqueId({ id, prefix: `${TEXT_INPUT_CLASSNAME}-` });
const liveErrorMessage = `${name} error, ${helperText}`;
Expand Down Expand Up @@ -99,12 +99,12 @@ export const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
)}

{rightElement && (
<span
<div
ref={rightElementRef}
className={textInputClassName.rightElement}
>
{rightElement}
</span>
</div>
)}

{error && helperText && (
Expand Down

0 comments on commit 4b8804a

Please sign in to comment.