telerik / kendo-ui-core

An HTML5, jQuery-based widget library for building modern web apps.
http://www.telerik.com/kendo-ui
Other
2.54k stars 1.9k forks source link

Editor - two new lines are create on pressing Shift + Enter keys #6159

Closed IvanDanchev closed 3 years ago

IvanDanchev commented 3 years ago

Bug report

Reproduction of the problem

Dojo example. Video available in ticket id: 1496525 (first post).

  1. Click at the end of line2 in paragraph1
  2. Press Enter
  3. Type in some text, e.g., "paragraph2"
  4. Press Shift + Enter

Current behavior

Two new lines are created instead of one.

Expected/desired behavior

One new line is created.

Environment

mparvanov commented 3 years ago
  1. Click at the end of line2 in paragraph1
  2. Press Shift + Enter A new line is not created
Dimitar-Goshev commented 3 years ago

The fix for this issue causes a JS error Object doesn't support property or method 'remove' in IE in the following scenario:

  1. Go to https://demos.telerik.com/kendo-ui/editor/immutable-elements?autoRun=true&theme=default
  2. Click after the end of the paragraph Lorem ipsum (after id facilisis.) OR Click after the end of the paragraph Aenean lacinia (after interdum ex.)
  3. Press Shift + Enter Error - Object doesn't support property or method 'remove' is thrown by linebreak.js
    if(!!br.nextSibling && dom.isWhitespace(br.nextSibling)) {
    br.nextSibling.remove();
    }