diff --git a/ui/v2.5/src/components/Scenes/SceneDetails/SceneEditPanel.scss b/ui/v2.5/src/components/Scenes/SceneDetails/SceneEditPanel.scss deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/ui/v2.5/src/components/Scenes/SceneDetails/SceneEditPanel.tsx b/ui/v2.5/src/components/Scenes/SceneDetails/SceneEditPanel.tsx index c05657e9037..2eab79bafda 100644 --- a/ui/v2.5/src/components/Scenes/SceneDetails/SceneEditPanel.tsx +++ b/ui/v2.5/src/components/Scenes/SceneDetails/SceneEditPanel.tsx @@ -674,6 +674,37 @@ export const SceneEditPanel: React.FC = ({ return renderInputField("details", "textarea", "details", props); } + const [titleInput, setTitleInput] = useState(scene.title ?? ""); + + const handleTitleKeyPress = ( + event: React.KeyboardEvent + ) => { + if (event.key === "Enter") { + event.preventDefault(); + const newTitle = titleInput + "\n"; + setTitleInput(newTitle); + formik.setFieldValue("title", newTitle); + } + }; + + function renderTitleField() { + return ( + { + const newValue = e.target.value; + setTitleInput(newValue); + formik.setFieldValue("title", newValue); + }} + onKeyPress={handleTitleKeyPress} + style={{ whiteSpace: "pre-wrap" }} + isInvalid={!!formik.errors.title} + /> + ); + } + return (
= ({ - {renderInputField("title", "textarea")} + {renderField( + "title", + intl.formatMessage({ id: "title" }), + renderTitleField() + )} {renderInputField("code", "text", "scene_code")} {renderURLListField("urls", onScrapeSceneURL, urlScrapable)}