Ionaru / Ionaru/easy-markdown-editor

Side-by-side preview pane rendering with the incorrect height

Open
#583 0 comments 2 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
3.1k
Forks
363
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When using a maximum height in units other than pixels, the side-by-side preview pane is rendered incorrectly, typically ending up much shorter than it should be.

**To Reproduce**
Steps to reproduce the behavior:
1. Set `maxHeight` to a non-pixel value e.g. `40rem`
2. Enable side-by-side without fullscreen

**Expected behavior**
The preview pane should be the same height as the editor pane.

**Version information**
- OS: Windows
- Browser: Chrome 122
- EasyMDE version: 2.18.0

**Additional context**
This issue doesn't occur when using fullscreen mode.

The trigger appears to be https://github.com/Ionaru/easy-markdown-editor/blob/master/src/js/easymde.js#L2555, as it's the only place where `options.maxHeight` is wrapped in `parseInt()`, causing the unit to be discarded.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.