Skip to content

Commit 6e543cf

Browse files
committed
auto-resize text
1 parent 0ee0cd9 commit 6e543cf

File tree

1 file changed

+13
-7
lines changed
  • exercises/99.final/01.solution.final/src/routes/app/recipients

1 file changed

+13
-7
lines changed

exercises/99.final/01.solution.final/src/routes/app/recipients/$id.tsx

+13-7
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,25 @@ export function RecipientRoute() {
133133
</div>
134134

135135
<div className="border-border flex-shrink-0 border-t p-4">
136-
<div className="flex items-center gap-4">
137-
<input
138-
type="text"
136+
<form
137+
onSubmit={(e) => {
138+
e.preventDefault()
139+
e.currentTarget.reset()
140+
}}
141+
className="flex items-center gap-4"
142+
>
143+
<textarea
139144
placeholder="Type your message..."
140-
className="text-foreground-alt placeholder:text-foreground-alt/60 flex-1 rounded-lg px-4 py-3"
145+
className="text-foreground-alt placeholder:text-foreground-alt/60 field-sizing-content max-h-[200px] min-h-[48px] flex-1 resize-none rounded-lg px-4 py-3"
146+
rows={1}
141147
/>
142-
<Button className="hidden whitespace-nowrap md:block">
148+
<Button type="submit" className="hidden whitespace-nowrap md:block">
143149
Add to Queue
144150
</Button>
145-
<Button className="block md:hidden" icon>
151+
<Button type="submit" className="block md:hidden" icon>
146152
<Icon name="Plus" />
147153
</Button>
148-
</div>
154+
</form>
149155
</div>
150156
</div>
151157
</div>

0 commit comments

Comments
 (0)