Skip to content

Commit

Permalink
fix: 块元素高度变高在下方的 hoverbar 会盖住内容
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchuzhang committed Jan 22, 2025
1 parent e3cbe33 commit 155e328
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/menus/bar/HoverBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class HoverBar {
// 获取选中的 node ,以及对应的 menu keys
const { isShow } = this
const { node = null, menuKeys = [] } = this.getSelectedNodeAndMenuKeys() || {}
const editor = this.getEditorInstance()

if (node != null) {
this.changeItemsState() // 更新菜单状态
Expand All @@ -315,9 +316,10 @@ class HoverBar {
if (isShow) {
// hoverbar 当前已显示
const samePath = this.isSamePath(node, this.prevSelectedNode)
const isBlock = Editor.isBlock(editor, node)

if (samePath) {
// 和之前选中的 node path 相同 —— 满足这些条件,即终止
if (!isBlock && samePath) {
// 不是块元素且和之前选中的 node path 相同 —— 满足这些条件,即终止
return
}
}
Expand Down

0 comments on commit 155e328

Please sign in to comment.