Skip to content

Commit

Permalink
feat: auto size text area in TaskUI
Browse files Browse the repository at this point in the history
  • Loading branch information
mondaychen committed Apr 22, 2024
1 parent 10257e8 commit 8e86d33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/AutosizeTextarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const AutosizeTextarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
w="100%"
resize="none"
ref={ref}
minRows={1}
minRows={4}
as={ResizeTextarea}
{...props}
/>
Expand Down
5 changes: 3 additions & 2 deletions src/common/TaskUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import VoiceButton from "./VoiceButton";
import TaskHistory from "./TaskHistory";
import TaskStatus from "./TaskStatus";
import RecommendedTasks from "./RecommendedTasks";
import AutosizeTextarea from "./AutosizeTextarea";

function ActionExecutor() {
const state = useAppState((state) => ({
Expand Down Expand Up @@ -102,12 +103,12 @@ const TaskUI = () => {

return (
<>
<Textarea
<AutosizeTextarea
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
placeholder="Try telling WebWand to do something..."
value={state.instructions || ""}
disabled={taskInProgress || state.isListening}
isDisabled={taskInProgress || state.isListening}
onChange={(e) => state.setInstructions(e.target.value)}
mb={2}
onKeyDown={onKeyDown}
Expand Down

0 comments on commit 8e86d33

Please sign in to comment.