From e835cafc3764fbd1a2ad3f24b4958ff0d8f5666a Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Thu, 1 Jul 2021 11:50:54 -0400 Subject: [PATCH] fix(studio): limit the max length of studio titles on the client side --- src/views/studio/studio-title.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/studio/studio-title.jsx b/src/views/studio/studio-title.jsx index e99273c3e..cfe64057e 100644 --- a/src/views/studio/studio-title.jsx +++ b/src/views/studio/studio-title.jsx @@ -23,6 +23,8 @@ const errorToMessageId = error => { } }; +const TITLE_MAX_LENGTH = 52; + const StudioTitle = ({ titleError, isFetching, isMutating, isMutedEditor, title, canEditInfo, handleUpdate }) => { @@ -52,6 +54,7 @@ const StudioTitle = ({ className={classNames('inplace-textarea', fieldClassName)} disabled={isMutating || !canEditInfo || isFetching} defaultValue={title} + maxLength={TITLE_MAX_LENGTH} onKeyDown={e => e.key === 'Enter' && e.target.blur()} onBlur={e => { if (e.target.value !== title) handleUpdate(e.target.value);