Skip to content

Commit ba74245

Browse files
fix: close toolbar overflow menu on click outside (#2377)
1 parent d44de69 commit ba74245

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/super-editor/src/components/toolbar/ButtonGroup.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ const isSeparator = (item) => item.type === 'separator';
7171
const isOverflow = (item) => item.type === 'overflow';
7272
7373
const getExpanded = (item) => {
74-
return Boolean(item?.expand?.value);
74+
if (!item) return false;
75+
const expand = item.expand;
76+
if (typeof expand === 'object' && expand !== null && 'value' in expand) {
77+
return Boolean(expand.value);
78+
}
79+
return Boolean(expand);
7580
};
7681
7782
const setExpanded = (item, open) => {

0 commit comments

Comments
 (0)