suneditor icon indicating copy to clipboard operation
suneditor copied to clipboard

Height always take up entire body

Open trymeouteh opened this issue 3 years ago • 4 comments

Describe the bug The height of the editor will always take up the entire height of the body.

To Reproduce

<link rel="stylesheet" href="node_modules/suneditor/dist/css/suneditor.min.css">

<style>
    body {
        background-color: black;

        height: 1000%;
    }
</style>



<textarea id="myEditor"></textarea>



<script src="node_modules/suneditor/dist/suneditor.min.js"></script>

<script>
    const myEditor = SUNEDITOR.create('myEditor', {
        resizingBar: false,

        width: '100%',
        height: '400px',
    });
</script>

Expected behavior The height of the editor will be 400px.

Screenshots None

Desktop (please complete the following information):

  • OS: Linux Mint 21.1
  • Browser Firefox Developer Edition
  • Version 2.44.3

Smartphone (please complete the following information):

  • Device: LG V20
  • OS: Android
  • Browser Fennec
  • Version 2.44.3

Additional context None

trymeouteh avatar Feb 07 '23 19:02 trymeouteh

This issue is not reproduced. Check the code such as whether the height value is being entered in the generated html. 스크린샷 2023-02-20 오후 2 29 25

JiHong88 avatar Feb 20 '23 05:02 JiHong88

2.44.6 and it does show the height is added to the element in the browser.

<link rel="stylesheet" href="node_modules/suneditor/dist/css/suneditor.min.css">

<style>
    body {
        background-color: black;

        height: 1000%;
    }
</style>



<textarea id="myEditor"></textarea>



<script src="node_modules/suneditor/dist/suneditor.min.js"></script>

<script>
    const myEditor = SUNEDITOR.create('myEditor', {
        resizingBar: false,

        width: '100%',
        height: 400,
    });
</script>

Screenshot-from-2023-04-04-10-50-32.png

trymeouteh avatar Apr 04 '23 16:04 trymeouteh

This still persists in v2.45.1

However I think I found the issue. It is the height and width property for the .se-container class.

Here is my code

<link rel="stylesheet" href="node_modules/suneditor/dist/css/suneditor.min.css">

<style>
    body {
        background-color: red;
    }
</style>



<textarea id="myEditor"></textarea>



<script src="node_modules/suneditor/dist/suneditor.min.js"></script>

<script>
    SUNEDITOR.create('myEditor', {
        // Configuration options
        height: '400',
        width: '1200',
        buttonList: [
            ['undo', 'redo'],
            ['font', 'fontSize', 'formatBlock'],
            ['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'],
            ['removeFormat'],
            ['fontColor', 'hiliteColor'],
            ['outdent', 'indent'],
            ['align', 'horizontalRule', 'list', 'table'],
            ['link', 'image', 'video'],
            ['fullScreen', 'showBlocks', 'codeView'],
            ['preview', 'print'],
            ['save', 'template']
        ]
    });
</script>

And here is a picture of fixing the issue by disabling the height and width property in the .se-container class.

suneditor 2 45 1

trymeouteh avatar Mar 13 '24 04:03 trymeouteh

Opened my first pull request to solve this issue https://github.com/JiHong88/suneditor/pull/1416

trymeouteh avatar Jun 28 '24 17:06 trymeouteh