Skip to content

Commit

Permalink
Editor setHeight fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adi committed Oct 17, 2023
1 parent 872d408 commit cafc1f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions static-src/markdownx/js/markdownx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,7 @@ function updateHeight(editor: HTMLTextAreaElement): HTMLTextAreaElement {
// Ensure that the editor is resizable before anything else.
// Change size if scroll is larger that height, otherwise do nothing.

if (editor.scrollTop)
editor.style.height = `${editor.scrollTop + getHeight(editor)}px`;
editor.style.height = `${editor.scrollHeight - parseFloat( getComputedStyle(editor).paddingTop) - parseFloat( getComputedStyle(editor).paddingBottom)}px`;

return editor

Expand Down

0 comments on commit cafc1f7

Please sign in to comment.