mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui): add empty string placeholder to string fields
This commit is contained in:
@@ -1744,6 +1744,7 @@
|
||||
"openLibrary": "Open Library",
|
||||
"workflowThumbnail": "Workflow Thumbnail",
|
||||
"saveChanges": "Save Changes",
|
||||
"emptyStringPlaceholder": "<empty string>",
|
||||
"builder": {
|
||||
"deleteAllElements": "Delete All Form Elements",
|
||||
"resetAllNodeFields": "Reset All Node Fields",
|
||||
|
||||
@@ -4,12 +4,21 @@ import { useStringField } from 'features/nodes/components/flow/nodes/Invocation/
|
||||
import { NO_DRAG_CLASS, NO_PAN_CLASS, NO_WHEEL_CLASS } from 'features/nodes/types/constants';
|
||||
import type { StringFieldInputInstance, StringFieldInputTemplate } from 'features/nodes/types/field';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const StringFieldInput = memo(
|
||||
(props: FieldComponentProps<StringFieldInputInstance, StringFieldInputTemplate>) => {
|
||||
const { value, onChange } = useStringField(props);
|
||||
const { t } = useTranslation();
|
||||
|
||||
return <Input className={`${NO_DRAG_CLASS} ${NO_PAN_CLASS} ${NO_WHEEL_CLASS}`} value={value} onChange={onChange} />;
|
||||
return (
|
||||
<Input
|
||||
className={`${NO_DRAG_CLASS} ${NO_PAN_CLASS} ${NO_WHEEL_CLASS}`}
|
||||
placeholder={t('workflows.emptyStringPlaceholder')}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -4,14 +4,17 @@ import { useStringField } from 'features/nodes/components/flow/nodes/Invocation/
|
||||
import { NO_DRAG_CLASS, NO_PAN_CLASS, NO_WHEEL_CLASS } from 'features/nodes/types/constants';
|
||||
import type { StringFieldInputInstance, StringFieldInputTemplate } from 'features/nodes/types/field';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const StringFieldTextarea = memo(
|
||||
(props: FieldComponentProps<StringFieldInputInstance, StringFieldInputTemplate>) => {
|
||||
const { t } = useTranslation();
|
||||
const { value, onChange } = useStringField(props);
|
||||
|
||||
return (
|
||||
<Textarea
|
||||
className={`${NO_DRAG_CLASS} ${NO_PAN_CLASS} ${NO_WHEEL_CLASS}`}
|
||||
placeholder={t('workflows.emptyStringPlaceholder')}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
h="full"
|
||||
|
||||
@@ -171,7 +171,13 @@ const ListItemContent = memo(({ value, index, onRemoveString, onChangeString }:
|
||||
</FormLabel>
|
||||
</GridItem>
|
||||
<GridItem>
|
||||
<Input size="sm" resize="none" value={value} onChange={onChange} />
|
||||
<Input
|
||||
placeholder={t('workflows.emptyStringPlaceholder')}
|
||||
size="sm"
|
||||
resize="none"
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
/>
|
||||
</GridItem>
|
||||
<GridItem>
|
||||
<IconButton
|
||||
|
||||
Reference in New Issue
Block a user