mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
fix(studio): limit the max length of studio titles on the client side
This commit is contained in:
parent
4efbf000eb
commit
e835cafc37
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue