Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(task): let the Create Task modal scroll when content overflows (#21021)

Rdmclin28bc0d53b62e2
diff --git a/src/features/AgentTasks/CreateTaskModal/CreateTaskContent.tsx b/src/features/AgentTasks/CreateTaskModal/CreateTaskContent.tsx
index 5b42dcd1488..b7a160a172f 100644
--- a/src/features/AgentTasks/CreateTaskModal/CreateTaskContent.tsx
+++ b/src/features/AgentTasks/CreateTaskModal/CreateTaskContent.tsx
@@ -215,9 +215,11 @@ const CreateTaskContent = memo<CreateTaskContentProps>(
const handleTitleKeyDown = useTitleEnterToInstruction(editor);
return (
- <Flexbox onKeyDown={handleKeyDown}>
- <Flexbox horizontal style={{ padding: '16px 24px 0' }}>
- <Flexbox flex={1} style={{ minHeight: 180 }}>
+ <Flexbox flex={1} style={{ minHeight: 0 }} onKeyDown={handleKeyDown}>
+ <Flexbox horizontal style={{ minHeight: 0, padding: '16px 24px 0' }}>
+ {/* A block (not flex) scroller: the editor's overflow-hidden wrapper
+ would otherwise shrink to fit and clip instead of scrolling. */}
+ <div style={{ flex: 1, minHeight: 180, minWidth: 0, overflowY: 'auto' }}>
<input
autoFocus={canCreateTask}
disabled={!canCreateTask}
@@ -246,7 +248,7 @@ const CreateTaskContent = memo<CreateTaskContentProps>(
style={{ fontSize: 14, paddingBottom: 16 }}
onContentChange={handleContentChange}
/>
- </Flexbox>
+ </div>
<Flexbox horizontal gap={4} style={{ flexShrink: 0 }}>
{showInlineToggle && (
<ActionIcon
@@ -263,7 +265,11 @@ const CreateTaskContent = memo<CreateTaskContentProps>(
horizontal
align={'center'}
justify={'space-between'}
- style={{ borderTop: `1px solid ${cssVar.colorBorderSecondary}`, padding: '8px 16px' }}
+ style={{
+ borderTop: `1px solid ${cssVar.colorBorderSecondary}`,
+ flexShrink: 0,
+ padding: '8px 16px',
+ }}
>
<Flexbox horizontal gap={2} wrap={'wrap'}>
<TaskPriorityTag priority={priority} onChange={setPriority}>
diff --git a/src/features/AgentTasks/CreateTaskModal/index.tsx b/src/features/AgentTasks/CreateTaskModal/index.tsx
index 62ad695980f..a18aac4e6dc 100644
--- a/src/features/AgentTasks/CreateTaskModal/index.tsx
+++ b/src/features/AgentTasks/CreateTaskModal/index.tsx
@@ -10,7 +10,12 @@ export const createTaskModal = (props?: CreateTaskContentProps): ModalInstance =
footer: null,
maskClosable: true,
styles: {
+ // The popup caps itself at the viewport height; let the body shrink into
+ // it so the instruction area scrolls while the toolbar stays pinned.
content: {
+ display: 'flex',
+ flexDirection: 'column',
+ minHeight: 0,
overflow: 'hidden',
padding: 0,
},