Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions client/src/components/ui/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export interface TextAreaProps {
readOnly?: boolean;
autoFocus?: boolean;
rows?: number;
maxHeight?: string;
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

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

The new maxHeight prop is missing documentation. Following the pattern of the fixedHeight prop (line 108), consider adding a comment to explain its purpose and interaction with other height-related props.

For example:

maxHeight?: string; // Maximum height in CSS units (e.g., "500px"). Note: when fixedHeight is true, this may conflict with line-based height limiting.
Suggested change
maxHeight?: string;
maxHeight?: string; // Maximum height in CSS units (e.g., "500px"). Note: when fixedHeight is true, this may conflict with line-based height limiting.

Copilot uses AI. Check for mistakes.
placeholder?: string;
id?: string;
minHeight?: string;
Expand All @@ -116,6 +117,7 @@ const TextArea = React.forwardRef<HTMLDivElement, TextAreaProps>(
theme = "light",
lineWrapping = false,
fixedHeight = true,
maxHeight = "500px",
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

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

The new maxHeight prop with a default value of "500px" conflicts with the existing heightLimitExtension mechanism (lines 283-289).

When fixedHeight=true (the default), the component already sets a dynamic max-height via the heightLimitExtension based on line count:

  • Desktop: ~5400px (300 lines × 18px)
  • Mobile: ~1800px (100 lines × 18px)

The new maxHeight="500px" default will override this existing behavior, effectively breaking the line-based height limiting. This means all textareas will now be capped at 500px regardless of the fixedHeight setting.

Recommendation: Consider one of these approaches:

  1. Only pass maxHeight to CodeMirror when fixedHeight=false, or
  2. Set maxHeight default to undefined and only apply it when explicitly provided by consumers, or
  3. Conditionally apply maxHeight based on fixedHeight: maxHeight={isFixedHeight ? undefined : maxHeight}

This maintains backward compatibility while allowing consumers to opt into a fixed max-height when needed.

Suggested change
maxHeight = "500px",
maxHeight,

Copilot uses AI. Check for mistakes.
...props
},
_ref // The ref is not used, but forwardRef requires it.
Expand Down Expand Up @@ -739,6 +741,7 @@ const TextArea = React.forwardRef<HTMLDivElement, TextAreaProps>(
if (onChange) onChange(createSyntheticChangeEvent(val));
}}
minHeight={props.minHeight}
maxHeight={maxHeight}
lang={props.lang}
placeholder={props.placeholder}
readOnly={props.readOnly}
Expand Down