From 61e9249c98e3dc46ded04f38d86f21ef12661010 Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Wed, 6 Jan 2021 17:02:16 -0600 Subject: [PATCH] fix: prevent empty list title from being saved --- frontend/src/shared/components/List/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/shared/components/List/index.tsx b/frontend/src/shared/components/List/index.tsx index 4ae813f..b834da3 100644 --- a/frontend/src/shared/components/List/index.tsx +++ b/frontend/src/shared/components/List/index.tsx @@ -56,7 +56,11 @@ const List = React.forwardRef( }; const onBlur = () => { setEditingTitle(false); - onSaveName(listName); + if (listName.trim() === '') { + setListName(name); + } else { + onSaveName(listName); + } }; const onEscape = () => { if ($listNameRef && $listNameRef.current) {