xdan / jodit

Jodit - Best WYSIWYG Editor for You
https://xdsoft.net/jodit/
MIT License
1.68k stars 351 forks source link

Long text strings are not wrapping consistently in TEXTAREA #605

Open miltonh26 opened 3 years ago

miltonh26 commented 3 years ago

When typing into a TEXTAREA and the text string is longer than the width of the TEXTAREA input box, the string should automatically wrap down and continue typing without needing to enter a line break. Instead, the Jodit horizontal width is being expanded even though a maximum width has been set.

This occurs consistently in the web browsers tested on Kubuntu with a rare exception that it occassionally wraps correctly.

Tested on Windows its wraps correctly as expected in Chrome 87.0.4280.141, Firefox 81.0.2 and Edge 87.0.664.75. On the Jodit website the pages work correctly in Linux, so something is amiss. Perhaps there is a setting to set?

Jodit Version: 3.5.4

Browser: Firefox 84.0, Chromium 87.0.4280.88, Chrome Version 87.0.4280.88

OS: Kubuntu 20.04 (Ubuntu 20.04 base)

Is React App: false

Code

<textarea id="editor" name="editor"></textarea>
<script language="javascript">
  var editor = new Jodit("editor", {
    readonly: false,
    toolbar: true,
    toolbarInline: true,
    language: "en",                      
    enter: "BR",
    minwidth: 900,
    maxWidth: 900,
    //allowResizeX: false,                      
    toolbarButtonSize: "medium",
    uploader: {
      insertImageAsBase64URI: true
    },
    buttons: [ 
      'bold','underline','italic','strikethrough','|',
      'font','fontsize','align','brush','paragraph','|',
      'superscript','subscript','symbol','|',
      'cut','copy','paste','eraser','|',
      'undo','redo',
      '\n',
      'ol','ul','|',
      'indent','outdent','|',
      'table','hr','|',
      'link','image','video','fullsize','|',
      'selectall','source','preview','print','find','about'
      ],
   buttonsMD: [ 
      'bold','underline','italic','strikethrough','|',
      'font','fontsize','align','brush','paragraph','|',
      'superscript','subscript','symbol','|',
      'cut','copy','paste','eraser','|',
      'undo','redo',
      '\n',
      'ol','ul','|',
      'indent','outdent','|',
      'table','hr','|',
      'link','image','video','fullsize','|',
      'selectall','source','preview','print','find','about'
      ],
   buttonsSM: [ 
      'bold','underline','italic','strikethrough','|',
      'font','fontsize','align','brush','paragraph','|',
      'superscript','subscript','symbol','|',
      'cut','copy','paste','eraser','|',
      'undo','redo',
      '\n',
      'ol','ul','|',
      'indent','outdent','|',
      'table','hr','|',
      'link','image','video','fullsize','|',
      'selectall','source','preview','print','find','about'
      ],
   buttonsXS: [ 
      'bold','underline','italic','strikethrough','|',
      'font','fontsize','align','brush','paragraph','|',
      'superscript','subscript','symbol','|',
      'cut','copy','paste','eraser','|',
      'undo','redo',
      '\n',
      'ol','ul','|',
      'indent','outdent','|',
      'table','hr','|',
      'link','image','video','fullsize','|',
      'selectall','source','preview','print','find','about'
      ],
  });  
  </script> 
// A *self-contained* demonstration of the problem follows...

Expected behavior: When typing characters and the number of characters exceeds the space in the TEXTAREA the text should wrap and continue on the next line as one continuous string without a line break.

Actual behavior: As the text string becomes too long the Jodit width is growing horizontally rather than wrapping.

miltonh26 commented 3 years ago

Tested further with two different pages, each with a Jodit editor. One wraps as expected and the other doesn't. The configuration of the editors is the same within the same application. Please see the MP4 to show what they are doing and the source code screenshot comparing the two.

https://user-images.githubusercontent.com/5038455/107120844-e121d600-68c1-11eb-8de8-f68d1f1f14e3.mp4

Jodit Editors Screenshot_20210206

miltonh26 commented 3 years ago

Still seeing this issue. Sometimes Jodit wraps correctly, other times it doesn't. Appears there is a bug in the code triggering the inconsistent behavior seen.

siamahnaf commented 11 months ago

Getting same issue!

miltonh26 commented 6 months ago

Just updated to 4.2.5 and the issue persists.