Skip to content

Commit bc17835

Browse files
committed
feat: 支持取消分类
1 parent 442a37d commit bc17835

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/web/src/components/memo-editor-form.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,8 @@ export const MemoEditorForm = view(
824824
};
825825

826826
const handleSelectCategory = (categoryId: string | null) => {
827-
setSelectedCategoryId(categoryId);
827+
// 点击已选中的分类时取消选中
828+
setSelectedCategoryId(categoryId !== null && categoryId === selectedCategoryId ? null : categoryId);
828829
setIsCategoryDropdownOpen(false);
829830
};
830831

0 commit comments

Comments
 (0)