diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx index 858ac55f6d..48ca28f0fc 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx @@ -1,3 +1,4 @@ +import { memo, ChangeEvent } from 'react'; import { Textarea, Input } from '@chakra-ui/react'; import { useAppDispatch } from 'app/store/storeHooks'; import { fieldValueChanged } from 'features/nodes/store/nodesSlice'; @@ -5,9 +6,10 @@ import { StringInputFieldTemplate, StringInputFieldValue, } from 'features/nodes/types/types'; -import { ChangeEvent, memo } from 'react'; import { FieldComponentProps } from './types'; +const FIELD_PADDING = 20; + const StringInputFieldComponent = ( props: FieldComponentProps< StringInputFieldValue, @@ -31,12 +33,13 @@ const StringInputFieldComponent = ( ); }; - const textareaWidth = nodeWidth - 20; + const textareaWidth = nodeWidth - FIELD_PADDING; + + const textareaFieldNames = ['prompt', 'text']; return ( <> - {field.name.toLowerCase() === 'prompt' || - field.name.toLowerCase() === 'text' ? ( + {textareaFieldNames.includes(field.name.toLowerCase()) ? (