mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Only apply Textaera to Prompt
This commit is contained in:
parent
98b2734240
commit
585520d8d2
@ -1,4 +1,4 @@
|
||||
import { Textarea } from '@chakra-ui/react';
|
||||
import { Textarea, Input } from '@chakra-ui/react';
|
||||
import { useAppDispatch } from 'app/store/storeHooks';
|
||||
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
|
||||
import {
|
||||
@ -19,7 +19,9 @@ const StringInputFieldComponent = (
|
||||
const { nodeId, field, nodeWidth } = props;
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleValueChanged = (e: ChangeEvent<HTMLTextAreaElement>) => {
|
||||
const handleValueChanged = (
|
||||
e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
|
||||
) => {
|
||||
dispatch(
|
||||
fieldValueChanged({
|
||||
nodeId,
|
||||
@ -32,16 +34,26 @@ const StringInputFieldComponent = (
|
||||
const textareaWidth = nodeWidth - 20;
|
||||
|
||||
return (
|
||||
<Textarea
|
||||
style={{
|
||||
height: '150px',
|
||||
width: `${textareaWidth}px`,
|
||||
resize: 'none',
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
onChange={handleValueChanged}
|
||||
value={field.value}
|
||||
/>
|
||||
<>
|
||||
{field.name.toLowerCase() === 'prompt' ? (
|
||||
<Textarea
|
||||
style={{
|
||||
height: '150px',
|
||||
width: `${textareaWidth}px`,
|
||||
resize: 'none',
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
onChange={handleValueChanged}
|
||||
value={field.value}
|
||||
/>
|
||||
) : (
|
||||
<Input
|
||||
style={{ width: `${textareaWidth}px` }}
|
||||
onChange={handleValueChanged}
|
||||
value={field.value}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user