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 { useAppDispatch } from 'app/store/storeHooks';
|
||||||
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
|
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
|
||||||
import {
|
import {
|
||||||
@ -19,7 +19,9 @@ const StringInputFieldComponent = (
|
|||||||
const { nodeId, field, nodeWidth } = props;
|
const { nodeId, field, nodeWidth } = props;
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const handleValueChanged = (e: ChangeEvent<HTMLTextAreaElement>) => {
|
const handleValueChanged = (
|
||||||
|
e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
|
||||||
|
) => {
|
||||||
dispatch(
|
dispatch(
|
||||||
fieldValueChanged({
|
fieldValueChanged({
|
||||||
nodeId,
|
nodeId,
|
||||||
@ -32,16 +34,26 @@ const StringInputFieldComponent = (
|
|||||||
const textareaWidth = nodeWidth - 20;
|
const textareaWidth = nodeWidth - 20;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Textarea
|
<>
|
||||||
style={{
|
{field.name.toLowerCase() === 'prompt' ? (
|
||||||
height: '150px',
|
<Textarea
|
||||||
width: `${textareaWidth}px`,
|
style={{
|
||||||
resize: 'none',
|
height: '150px',
|
||||||
overflowY: 'auto',
|
width: `${textareaWidth}px`,
|
||||||
}}
|
resize: 'none',
|
||||||
onChange={handleValueChanged}
|
overflowY: 'auto',
|
||||||
value={field.value}
|
}}
|
||||||
/>
|
onChange={handleValueChanged}
|
||||||
|
value={field.value}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Input
|
||||||
|
style={{ width: `${textareaWidth}px` }}
|
||||||
|
onChange={handleValueChanged}
|
||||||
|
value={field.value}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user