fix: prevent empty list title from being saved

This commit is contained in:
Jordan Knott 2021-01-06 17:02:16 -06:00
parent c347c6bdc3
commit 61e9249c98

View File

@ -56,7 +56,11 @@ const List = React.forwardRef(
}; };
const onBlur = () => { const onBlur = () => {
setEditingTitle(false); setEditingTitle(false);
onSaveName(listName); if (listName.trim() === '') {
setListName(name);
} else {
onSaveName(listName);
}
}; };
const onEscape = () => { const onEscape = () => {
if ($listNameRef && $listNameRef.current) { if ($listNameRef && $listNameRef.current) {