@syncfusion/ej2-richtexteditor 20.1.51 → 20.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4253,7 +4253,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
4253
4253
  if ((parent_1.bottom < (floatOffset + tbHeight + topValue)) || parent_1.bottom < 0 || parent_1.top > floatOffset + topValue) {
4254
4254
  isFloat = false;
4255
4255
  }
4256
- else if (parent_1.top < floatOffset) {
4256
+ else if (parent_1.top < floatOffset || parent_1.top < floatOffset + topValue) {
4257
4257
  isFloat = true;
4258
4258
  }
4259
4259
  }
@@ -11510,7 +11510,7 @@ var NodeCutter = /** @__PURE__ @class */ (function () {
11510
11510
  else if (len > -1) {
11511
11511
  this.spliceEmptyNode(fragment.childNodes[0], isStart);
11512
11512
  }
11513
- else if (fragment.nodeType !== 3 && fragment.nodeType !== 11) {
11513
+ else if (fragment.nodeType !== 3 && fragment.nodeType !== 11 && fragment.nodeName !== 'IMG') {
11514
11514
  fragment.parentNode.removeChild(fragment);
11515
11515
  }
11516
11516
  return fragment;
@@ -12336,7 +12336,8 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
12336
12336
  tempSpan.parentNode.replaceChild(node, tempSpan);
12337
12337
  }
12338
12338
  else {
12339
- var currentNode = nodes[nodes.length - 1];
12339
+ var nodeSelection = new NodeSelection();
12340
+ var currentNode = this.getNodeCollection(range, nodeSelection, node)[this.getNodeCollection(range, nodeSelection, node).length - 1];
12340
12341
  var splitedElm = void 0;
12341
12342
  if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR') && !isNullOrUndefined(currentNode.parentElement) &&
12342
12343
  currentNode.parentElement.textContent.trim().length === 0) {
@@ -23344,7 +23345,7 @@ var Table = /** @__PURE__ @class */ (function () {
23344
23345
  EventHandler.remove(_this.contentModule.getEditPanel(), 'mouseover', _this.resizeHelper);
23345
23346
  }
23346
23347
  var widthType = _this.curTable.style.width.indexOf('%') > -1;
23347
- _this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, rteWidth) + '%'
23348
+ _this.curTable.style.width = widthType && !_this.curTable.closest('TD') ? _this.convertPixelToPercentage(tableWidth + mouseX, rteWidth) + '%'
23348
23349
  : tableWidth + mouseX + 'px';
23349
23350
  _this.curTable.style.height = tableHeight + mouseY + 'px';
23350
23351
  tableReBox.classList.add('e-rbox-select');
@@ -24776,8 +24777,9 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24776
24777
  };
24777
24778
  EnterKeyAction.prototype.removeBRElement = function (currentElement) {
24778
24779
  if (Browser.userAgent.indexOf('Firefox') != -1 &&
24779
- this.range.endOffset === currentElement.textContent.length &&
24780
- currentElement.lastChild.nodeName === 'BR') {
24780
+ this.range.endOffset === currentElement.textContent.length && (currentElement.textContent.length !== 0 ||
24781
+ currentElement.querySelectorAll('BR').length > 1) &&
24782
+ !isNullOrUndefined(currentElement.lastChild) && currentElement.lastChild.nodeName === 'BR') {
24781
24783
  detach(currentElement.lastChild);
24782
24784
  }
24783
24785
  };