Skip to content

Commit

Permalink
fix: editor height calculation with hidden toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
SystemChanger committed Jan 26, 2023
1 parent 6f63592 commit 66c92ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -7615,7 +7615,9 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
onResize_window: function () {
if (util.isIE) core.resetResponsiveToolbar();

if (context.element.toolbar.offsetWidth === 0) return;
const toolbar = context.element.toolbar;
const isToolbarHidden = (toolbar.style.display === 'none' || (core._isInline && !core._inlineToolbarAttr.isShow));
if (context.element.toolbar.offsetWidth === 0 && !isToolbarHidden) return;

if (context.fileBrowser && context.fileBrowser.area.style.display === 'block') {
context.fileBrowser.body.style.maxHeight = (_w.innerHeight - context.fileBrowser.header.offsetHeight - 50) + 'px';
Expand Down Expand Up @@ -8898,6 +8900,8 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
context.element.toolbar.style.display = '';
context.element._stickyDummy.style.display = '';
}

event.onResize_window();
},

/**
Expand All @@ -8910,6 +8914,8 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
context.element.toolbar.style.display = 'none';
context.element._stickyDummy.style.display = 'none';
}

event.onResize_window();
},
},

Expand Down

0 comments on commit 66c92ae

Please sign in to comment.