Skip to content

Commit

Permalink
fix multiline text inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
dnbrwstr committed Jan 14, 2025
1 parent f0cf796 commit 5fcb2c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/app/fixtures/Form.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const FormFixture = () => {
number: 'one',
listItem: 'chat',
image: undefined,
textarea: undefined,
},
});

Expand Down Expand Up @@ -97,6 +98,23 @@ const FormFixture = () => {
control={control}
/>

<Form.ControlledTextareaField
name="textarea"
label="Textarea"
control={control}
inputProps={{
placeholder: 'Put some text here',
numberOfLines: 5,
multiline: true,
}}
rules={{
maxLength: {
value: 300,
message: 'Bug report notes are limited to 300 characters',
},
}}
/>

<Form.Field label="Toggle group">
<Form.ToggleGroupInput
value={selectedToggleGroupOption}
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/components/Form/inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ const TextInputComponent = RawTextInput.styleable<{
return (
<InputFrame
accent={accent ?? fieldContext.accent}
{...(props.numberOfLines && props.numberOfLines !== 1
? { height: 'unset' }
: {})}
backgroundType={backgroundType ?? fieldContext.backgroundType}
>
{icon ? <Icon type={icon} size="$m" /> : null}
Expand Down

0 comments on commit 5fcb2c4

Please sign in to comment.