@syncfusion/ej2-richtexteditor 24.1.43 → 24.1.45

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.
@@ -16372,8 +16372,7 @@ class SelectionCommands {
16372
16372
  cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
16373
16373
  cursorNodes[0].innerHTML = '';
16374
16374
  }
16375
- if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
16376
- cursorNodes[0].nextSibling.nodeName === 'BR')) {
16375
+ if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNullOrUndefined(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
16377
16376
  detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
16378
16377
  }
16379
16378
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
@@ -18800,7 +18799,8 @@ class ToolbarStatus {
18800
18799
  // eslint-disable-next-line
18801
18800
  const pattern = new RegExp(name, 'i');
18802
18801
  if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
18803
- (value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
18802
+ (value.split(',')[0] && !isNullOrUndefined(value.split(',')[0].trim().match(pattern)) &&
18803
+ value.split(',')[0].trim() === value.split(',')[0].trim().match(pattern)[0])) {
18804
18804
  index = pos;
18805
18805
  }
18806
18806
  }) && (index !== null)))) {
@@ -34480,6 +34480,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34480
34480
  }
34481
34481
  EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
34482
34482
  EventHandler.add(this.inputElement, 'paste', this.onPaste, this);
34483
+ EventHandler.add(this.inputElement, 'content-changed', this.contentChanged, this);
34483
34484
  EventHandler.add(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30), this);
34484
34485
  EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
34485
34486
  this.wireContextEvent();
@@ -34542,6 +34543,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34542
34543
  }
34543
34544
  EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
34544
34545
  EventHandler.remove(this.inputElement, 'paste', this.onPaste);
34546
+ EventHandler.remove(this.inputElement, 'content-changed', this.contentChanged);
34545
34547
  EventHandler.remove(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30));
34546
34548
  EventHandler.remove(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler);
34547
34549
  this.unWireContextEvent();