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 = () => {
setEditingTitle(false);
onSaveName(listName);
if (listName.trim() === '') {
setListName(name);
} else {
onSaveName(listName);
}
};
const onEscape = () => {
if ($listNameRef && $listNameRef.current) {