Skip to content

Commit

Permalink
fix: prevent content and label overlap in InputTextarea
Browse files Browse the repository at this point in the history
  • Loading branch information
wp-aberg committed Oct 26, 2023
1 parent 1694a17 commit 3221741
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ui/input-textarea/src/InputTextarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ const TextAreaLabel = styled(InputLabel, {
variants: {
isFloating: {
true: {
fontSize: theme.fontSizes["075"],
lineHeight: theme.lineHeights["100"],
fontSize: FloatingLabelStyles.fontSize,
lineHeight: FloatingLabelStyles.lineHeight,
transform: `translateY(0)`,
},
},
},
Expand All @@ -59,12 +60,6 @@ const ControlCSS = css({
display: "flex",
flexDirection: "column",
position: "relative",

"&:focus-within": {
[`& ${TextAreaLabel}`]: {
...FloatingLabelStyles,
},
},
});

export interface InputTextareaProps
Expand Down Expand Up @@ -174,7 +169,10 @@ export const InputTextarea = React.forwardRef<
}, []);

const [isFloating, handleFocus, handleBlur, handleChange] = useFloating(
value || defaultValue || placeholder,
(internalRef.current ? internalRef.current.value : "") ||
value ||
defaultValue ||
placeholder,
onFocus,
onBlur,
onChange,
Expand Down

4 comments on commit 3221741

@vercel
Copy link

@vercel vercel bot commented on 3221741 Oct 26, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 3221741 Oct 26, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

wpds-ui-kit-vitejs-example – ./apps/vite-project

wpds-ui-kit-vitejs-example-git-main.preview.now.washingtonpost.com
wpds-ui-kit-vitejs-example.preview.now.washingtonpost.com

@vercel
Copy link

@vercel vercel bot commented on 3221741 Oct 26, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

wpds-ui-kit-storybook – ./

wpds-ui-kit-storybook.preview.now.washingtonpost.com
wpds-ui-kit-storybook-git-main.preview.now.washingtonpost.com

@vercel
Copy link

@vercel vercel bot commented on 3221741 Oct 26, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

wpds-ui-kit – ./build.washingtonpost.com

wpds-ui-kit.preview.now.washingtonpost.com
wpds-ui-kit-git-main.preview.now.washingtonpost.com
build.washingtonpost.com

Please sign in to comment.