diff --git a/src/bundle/WysiwygEditorView.scss b/src/bundle/WysiwygEditorView.scss index e3eab6d6..7dd3a3d7 100644 --- a/src/bundle/WysiwygEditorView.scss +++ b/src/bundle/WysiwygEditorView.scss @@ -11,7 +11,8 @@ &__editor { overflow-y: auto; flex-grow: 1; - + // Ensure empty editor has clickable area + min-height: 36px; padding: var(--g-md-editor-padding); .g-root_theme_dark & .pm-iframe-container { diff --git a/tests/visual-tests/ClickableArea.visual.test.tsx b/tests/visual-tests/ClickableArea.visual.test.tsx new file mode 100644 index 00000000..3d10b2dc --- /dev/null +++ b/tests/visual-tests/ClickableArea.visual.test.tsx @@ -0,0 +1,16 @@ +import {test, expect} from 'playwright/core'; +import {PresetsStories} from './Presets.helpers'; + +const getHeights = async (page) => { + const container = page.locator('.g-md-wysiwyg-editor__editor'); + const editor = container.locator('.ProseMirror'); + const containerBox = await container.boundingBox(); + const editorBox = await editor.boundingBox(); + return {containerHeight: containerBox?.height, editorHeight: editorBox?.height}; +}; + +test('zero preset clickable area', async ({mount, page}) => { + await mount(); + const {containerHeight, editorHeight} = await getHeights(page); + expect(containerHeight).toBeCloseTo(editorHeight!, 1); +});