Skip to content

Commit

Permalink
fix rest of the forms
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomsik committed May 3, 2024
1 parent fe08141 commit 9238222
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/_components/AutoGrowTextarea.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const AutoGrowTextarea = ({ class: className = "", ...props }) => (
export const AutoGrowTextarea = ({ class: className = "", value, onChange, ...props }) => (
<div class="vstack relative">
<textarea class={`!absolute !inset-0 ${className}`} {...props} />
<textarea class={`!absolute !inset-0 ${className}`} value={value} onInput={e => onChange(e.target!.value)} {...props} />
<div
// render to invisible pseudo element, used to measure the height
class={`form-control ${className} invisible whitespace-pre-wrap max-h-[30vh] overflow-y-hidden after:content-[attr(data-value)_"_"]`}
Expand Down
2 changes: 1 addition & 1 deletion src/app/chat/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ChatInput = ({ value, onChange, onSend, abort }) => {
rows={1}
placeholder="Ask anything..."
value={value}
onInput={e => onChange(e.target.value)}
onChange={onChange}
onKeyDown={handleKeyDown}
/>
<IconButton class="absolute bottom-[9px] right-2" title="Send" icon={SendHorizontal} abort={abort} submit />
Expand Down
2 changes: 1 addition & 1 deletion src/app/chat/ChatPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ChatPrompt = ({ chat, onSave }) => {
</div>
</Form>
) : (
<div class="text-neutral-9">{chat.prompt ?? defaultPrompt}</div>
<div class="text-neutral-9 whitespace-pre-wrap">{chat.prompt ?? defaultPrompt}</div>
)}
</div>
)
Expand Down

0 comments on commit 9238222

Please sign in to comment.