From 8183fcbd4459c82a2e00a58217122a7daee6259a Mon Sep 17 00:00:00 2001 From: Prathamesh Chavan Date: Sun, 27 Aug 2023 20:10:09 +0530 Subject: [PATCH] fix: BlockTypeDropdown can not select Heading --- .../components/DefaultDropdowns/BlockTypeDropdown.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react/src/FormattingToolbar/components/DefaultDropdowns/BlockTypeDropdown.tsx b/packages/react/src/FormattingToolbar/components/DefaultDropdowns/BlockTypeDropdown.tsx index 13d80a6ed..de3bda689 100644 --- a/packages/react/src/FormattingToolbar/components/DefaultDropdowns/BlockTypeDropdown.tsx +++ b/packages/react/src/FormattingToolbar/components/DefaultDropdowns/BlockTypeDropdown.tsx @@ -112,7 +112,11 @@ export const BlockTypeDropdown = (props: { props: {}, }); }, - isSelected: block.type === item.type, + isSelected: + block.type === item.type && + (block.type === "heading" + ? block.props.level === item.props?.level + : true), })), [block, filteredItems, props.editor] );