mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 12:32:00 +08:00
fix(editor): should auto close dropdown menus on toolbar (#11522)
Closes: [BS-2524](https://linear.app/affine-design/issue/BS-2524/切换-block-后,刷新-toolbar-时,应该自动关闭已经打开的-dropdown)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
type EditorMenuButton,
|
||||
type EditorToolbar,
|
||||
renderToolbarSeparator,
|
||||
} from '@blocksuite/affine-components/toolbar';
|
||||
@@ -129,6 +130,10 @@ export function autoUpdatePosition(
|
||||
if (toolbar.dataset.open) {
|
||||
if (middlewareData.hide.referenceHidden) {
|
||||
delete toolbar.dataset.open;
|
||||
// Closes dropdown menus
|
||||
toolbar
|
||||
.querySelector<EditorMenuButton>('editor-menu-button[data-open]')
|
||||
?.hide();
|
||||
}
|
||||
} else {
|
||||
toolbar.dataset.open = 'true';
|
||||
|
||||
Reference in New Issue
Block a user