diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js index 9c332499..a51e6ca4 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js @@ -1,5 +1,6 @@ const setPanelContentMaxHeight = (balloonView) => { const HEADER_HEIGHT = 90; + const MIN_HEIGHT_VALUE = 220; const { innerHeight: windowHeight } = window; const { top: panelTopPosition, element: panelNode } = balloonView; const panelHeader = panelNode.querySelector('.ibexa-custom-tag-panel-header'); @@ -16,8 +17,9 @@ const setPanelContentMaxHeight = (balloonView) => { const maxHeightValue = isPanelOverTopWindowEdge ? panelContent.offsetHeight - Math.abs(panelTopPosition) : windowHeight - panelTopPosition - panelHeaderHeight - panelFooterHeight; + const panelMaxHeight = maxHeightValue < MIN_HEIGHT_VALUE ? MIN_HEIGHT_VALUE : maxHeightValue; - panelContent.style.maxHeight = `${maxHeightValue}px`; + panelContent.style.maxHeight = `${panelMaxHeight}px`; }; export { setPanelContentMaxHeight };