Skip to content

Commit b352a35

Browse files
committed
fix: set max rows of Comment text input to 20
1 parent d850805 commit b352a35

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

apps/builder/app/builder/features/settings-panel/controls/text.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const TextControl = ({
4848
value={localValue.value}
4949
rows={meta.rows ?? 1}
5050
// Set maxRows to 3 when meta.rows is undefined or equal to 1, otherwise set it to rows * 2
51-
maxRows={Math.max(2 * (meta.rows ?? 1), 3)}
51+
maxRows={meta.maxRows ?? Math.max(2 * (meta.rows ?? 1), 3)}
5252
onChange={localValue.set}
5353
onBlur={localValue.save}
5454
onSubmit={localValue.save}

apps/builder/app/canvas/canvas.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ export const Canvas = () => {
245245
required: false,
246246
description:
247247
"Describe the behavior of this layer and optionally its children.",
248+
maxRows: 20,
248249
};
249250
propsMeta.initialProps ??= [];
250251
propsMeta.initialProps.push("comment");

packages/sdk/src/schema/prop-meta.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const Text = z.object({
4040
* In line with Storybook team's plan: https://github.com/storybookjs/storybook/issues/21100
4141
*/
4242
rows: z.number().optional(),
43+
maxRows: z.number().optional(),
4344
});
4445

4546
const Resource = z.object({

0 commit comments

Comments
 (0)