diff --git a/frontend/src/lib/lemon-ui/LemonTextArea/LemonTextArea.tsx b/frontend/src/lib/lemon-ui/LemonTextArea/LemonTextArea.tsx index f5732d3c12aa..9696d3282972 100644 --- a/frontend/src/lib/lemon-ui/LemonTextArea/LemonTextArea.tsx +++ b/frontend/src/lib/lemon-ui/LemonTextArea/LemonTextArea.tsx @@ -13,6 +13,7 @@ interface LemonTextAreaPropsBase extends Pick< value?: string placeholder?: string className?: string + textareaClassName?: string /** Whether input field is disabled */ disabled?: boolean ref?: React.Ref @@ -54,6 +55,7 @@ export type LemonTextAreaProps = LemonTextAreaWithEnterProps | LemonTextAreaWith export const LemonTextArea = React.forwardRef(function LemonTextArea( { className, + textareaClassName, onChange, onPressEnter, onPressCmdEnter, @@ -80,7 +82,12 @@ export const LemonTextArea = React.forwardRef { if (stopPropagation) { e.stopPropagation() diff --git a/frontend/src/scenes/max/components/QuestionInput.test.tsx b/frontend/src/scenes/max/components/QuestionInput.test.tsx index 3ed3fa138e07..e1b2b0cd4076 100644 --- a/frontend/src/scenes/max/components/QuestionInput.test.tsx +++ b/frontend/src/scenes/max/components/QuestionInput.test.tsx @@ -76,4 +76,11 @@ describe('QuestionInput slash command autocomplete', () => { fireEvent.change(input, { target: { value: '/' } }) await waitFor(() => expect(slashCommandItem()).toBeInTheDocument()) }) + + it('keeps long prompts scrollable inside the input', () => { + const input = screen.getByRole('textbox') + + expect(input).toHaveClass('max-h-[min(40vh,16rem)]') + expect(input).toHaveClass('overflow-y-auto') + }) }) diff --git a/frontend/src/scenes/max/components/QuestionInput.tsx b/frontend/src/scenes/max/components/QuestionInput.tsx index 4a5d19f4209d..3ad81fabb6c4 100644 --- a/frontend/src/scenes/max/components/QuestionInput.tsx +++ b/frontend/src/scenes/max/components/QuestionInput.tsx @@ -365,6 +365,7 @@ export const QuestionInput = React.forwardRef