@syncfusion/ej2-richtexteditor 21.1.39 → 21.2.3

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.
@@ -15793,18 +15793,13 @@ class SelectionCommands {
15793
15793
  isSubSup = formatNode === null ? false : true;
15794
15794
  }
15795
15795
  }
15796
- else if ((format === 'fontsize' || format === 'fontname' || format === 'fontcolor' || format === 'backgroundcolor') && range.startContainer.parentElement === endNode) {
15797
- formatNode = null;
15798
- }
15799
15796
  if (index === 0 && formatNode === null) {
15800
15797
  isFormat = true;
15801
15798
  }
15802
15799
  if (formatNode !== null && (!isFormat || isFontStyle)) {
15803
15800
  nodes[index] = this.removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode);
15804
15801
  }
15805
- else if (range.startContainer.parentElement !== endNode ||
15806
- (range.commonAncestorContainer !== endNode && range.startContainer.parentElement === endNode)
15807
- || (range.commonAncestorContainer === endNode || nodes.length === 1)) {
15802
+ else {
15808
15803
  nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode);
15809
15804
  }
15810
15805
  domSelection = this.applySelection(nodes, domSelection, nodeCutter, index, isCollapsed);
@@ -15956,6 +15951,27 @@ class SelectionCommands {
15956
15951
  nodes[index] = lastNode.firstChild;
15957
15952
  }
15958
15953
  }
15954
+ else if (isFontStyle && !nodes[index].contains(formatNode) && nodes[index].nodeType === 3 &&
15955
+ nodes[index].textContent !== formatNode.textContent) {
15956
+ // If the selection is within the format node .
15957
+ const isFullNodeSelected = nodes[index].textContent === nodes[index].wholeText;
15958
+ let nodeTraverse = nodes[index];
15959
+ const styleElement = this.GetFormatNode(format, value);
15960
+ // while loop and traverse back until text content does not match with parent text content
15961
+ while (nodeTraverse && nodeTraverse.textContent === nodeTraverse.parentElement.textContent) {
15962
+ nodeTraverse = nodeTraverse.parentElement;
15963
+ }
15964
+ if (isFullNodeSelected && formatNode.textContent !== nodeTraverse.textContent) {
15965
+ const nodeArray = [];
15966
+ const priorityNode = this.getPriorityFormatNode(nodeTraverse, endNode);
15967
+ if (priorityNode && priorityNode.textContent === nodeTraverse.textContent) {
15968
+ nodeTraverse = priorityNode;
15969
+ }
15970
+ nodeArray.push(nodeTraverse);
15971
+ this.applyStyles(nodeArray, 0, styleElement);
15972
+ return nodes[index];
15973
+ }
15974
+ }
15959
15975
  let fontStyle;
15960
15976
  if (format === 'backgroundcolor') {
15961
15977
  fontStyle = formatNode.style.fontSize;
@@ -16102,23 +16118,9 @@ class SelectionCommands {
16102
16118
  return nodes[index];
16103
16119
  }
16104
16120
  static insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode) {
16105
- let rootElementNode;
16106
16121
  if (!isCursor) {
16107
16122
  if ((formatNode === null && isFormat) || isFontStyle) {
16108
16123
  if (nodes[index].nodeName !== 'BR') {
16109
- if (format === 'fontsize' || format === 'fontname' || format === 'fontcolor' || format === 'backgroundcolor') {
16110
- let rangeNode = nodes[index];
16111
- while (rangeNode && !domNode.isBlockNode(rangeNode) && rangeNode !== endNode) {
16112
- if (domNode.isBlockNode(rangeNode.parentElement)) {
16113
- rootElementNode = rangeNode;
16114
- }
16115
- rangeNode = rangeNode.parentElement;
16116
- }
16117
- if (rootElementNode && rootElementNode.nodeType !== 3) {
16118
- nodeCutter.SplitNode(range, rootElementNode, true).cloneNode(true);
16119
- nodeCutter.SplitNode(range, rootElementNode, false).cloneNode(false);
16120
- }
16121
- }
16122
16124
  nodes[index] = nodeCutter.GetSpliceNode(range, nodes[index]);
16123
16125
  nodes[index].textContent = nodeCutter.TrimLineBreak(nodes[index].textContent);
16124
16126
  }
@@ -16128,57 +16130,63 @@ class SelectionCommands {
16128
16130
  }
16129
16131
  else if (!(isFontStyle === true && value === '')) {
16130
16132
  const element = this.GetFormatNode(format, value);
16131
- if (value === 'formatPainter' || format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
16132
- if (format !== 'fontname' && format !== 'backgroundcolor') {
16133
- let liElement = nodes[index].parentElement;
16134
- let parentElement = nodes[index].parentElement;
16135
- while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
16136
- parentElement = parentElement.parentElement;
16137
- liElement = parentElement;
16133
+ if (value === 'formatPainter' || isFontStyle) {
16134
+ let liElement = nodes[index].parentElement;
16135
+ let parentElement = nodes[index].parentElement;
16136
+ while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
16137
+ parentElement = parentElement.parentElement;
16138
+ liElement = parentElement;
16139
+ }
16140
+ if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
16141
+ liElement.textContent.trim() === nodes[index].textContent.trim()) {
16142
+ if (format === 'fontsize') {
16143
+ liElement.style.fontSize = value;
16138
16144
  }
16139
- if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
16140
- liElement.textContent.trim() === nodes[index].textContent.trim()) {
16141
- if (format === 'fontsize') {
16142
- liElement.style.fontSize = value;
16143
- }
16144
- else {
16145
- liElement.style.color = value;
16146
- liElement.style.textDecoration = 'inherit';
16147
- }
16145
+ else if (format === 'fontcolor') {
16146
+ liElement.style.color = value;
16147
+ liElement.style.textDecoration = 'inherit';
16148
16148
  }
16149
16149
  }
16150
- if (rootElementNode && rootElementNode.nodeType !== 3 && rootElementNode.nodeName !== 'A') {
16151
- const save = new NodeSelection();
16152
- save.save(range, docElement);
16153
- domNode.setMarker(save);
16154
- const cloneNode = rootElementNode.cloneNode(true);
16155
- element.appendChild(cloneNode);
16156
- domNode.replaceWith(rootElementNode, element.outerHTML);
16157
- const currentStartNode = endNode.querySelector('.e-editor-select-start');
16158
- const currrentEndNode = endNode.querySelector('.e-editor-select-end');
16159
- if (index === 0) {
16160
- nodes[index] = currentStartNode ? currentStartNode.lastChild : nodes[index];
16161
- }
16162
- if (range.startContainer.parentElement === endNode) {
16163
- if (nodes.length > 1) {
16164
- nodes[nodes.length - 1] = currrentEndNode ? currrentEndNode.lastChild : nodes[index];
16150
+ if (value === 'formatPainter') {
16151
+ return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
16152
+ }
16153
+ const currentNode = nodes[index];
16154
+ const priorityNode = this.getPriorityFormatNode(currentNode, endNode);
16155
+ // 1. Checking is there any priority node present in the selection range. (Use case for nested styles);
16156
+ // 2 Or font style is applied. (Use case not a nested style)
16157
+ if (!isNullOrUndefined(priorityNode) || isFontStyle) {
16158
+ let currentFormatNode = isNullOrUndefined(priorityNode) ? currentNode : priorityNode;
16159
+ currentFormatNode = !isNullOrUndefined(priorityNode) && priorityNode.style.fontSize !== '' ?
16160
+ currentFormatNode.firstChild : currentFormatNode;
16161
+ if (isNullOrUndefined(priorityNode) || format === 'fontsize') {
16162
+ while (currentFormatNode) {
16163
+ const isSameTextContent = currentFormatNode.parentElement.textContent.trim()
16164
+ === nodes[index].textContent.trim();
16165
+ if (!domNode.isBlockNode(currentFormatNode.parentElement) && isSameTextContent) {
16166
+ currentFormatNode = currentFormatNode.parentElement;
16167
+ }
16168
+ else {
16169
+ break;
16170
+ }
16165
16171
  }
16166
16172
  }
16167
- domNode.saveMarker(save, null);
16168
- }
16169
- else {
16170
- if (value === 'formatPainter') {
16171
- return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
16173
+ const nodeList = [];
16174
+ // Since color is different for different themnes, we need to wrap the fontColor over the text node.
16175
+ if (format === 'fontcolor') {
16176
+ const closestAnchor = closest(nodes[index].parentElement, 'A');
16177
+ if (!isNullOrUndefined(closestAnchor) && closestAnchor.firstChild.textContent.trim()
16178
+ === nodes[index].textContent.trim()) {
16179
+ currentFormatNode = nodes[index];
16180
+ }
16172
16181
  }
16173
- else {
16174
- nodes[index] = this.applyStyles(nodes, index, element);
16182
+ if (nodes[index].textContent.trim() !== currentFormatNode.textContent.trim()) {
16183
+ currentFormatNode = nodes[index];
16175
16184
  }
16185
+ nodeList[0] = currentFormatNode;
16186
+ this.applyStyles(nodeList, 0, element);
16176
16187
  }
16177
- if (format === 'fontsize') {
16178
- const bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
16179
- if (!isNullOrUndefined(bg)) {
16180
- nodes[index].parentElement.style.backgroundColor = bg.style.backgroundColor;
16181
- }
16188
+ else {
16189
+ nodes[index] = this.applyStyles(nodes, index, element);
16182
16190
  }
16183
16191
  }
16184
16192
  else {
@@ -16211,6 +16219,37 @@ class SelectionCommands {
16211
16219
  }
16212
16220
  return nodes[index];
16213
16221
  }
16222
+ static getPriorityFormatNode(node, endNode) {
16223
+ const isFormatted = new IsFormatted();
16224
+ const fontSizeNode = isFormatted.getFormattedNode(node, 'fontsize', endNode);
16225
+ let fontColorNode;
16226
+ let backgroundColorNode;
16227
+ let fontNameNode;
16228
+ if (isNullOrUndefined(fontSizeNode)) {
16229
+ backgroundColorNode = isFormatted.getFormattedNode(node, 'backgroundcolor', endNode);
16230
+ if (isNullOrUndefined(backgroundColorNode)) {
16231
+ fontNameNode = isFormatted.getFormattedNode(node, 'fontname', endNode);
16232
+ if (isNullOrUndefined(fontNameNode)) {
16233
+ fontColorNode = isFormatted.getFormattedNode(node, 'fontcolor', endNode);
16234
+ if (isNullOrUndefined(fontColorNode)) {
16235
+ return null;
16236
+ }
16237
+ else {
16238
+ return fontColorNode;
16239
+ }
16240
+ }
16241
+ else {
16242
+ return fontNameNode;
16243
+ }
16244
+ }
16245
+ else {
16246
+ return backgroundColorNode;
16247
+ }
16248
+ }
16249
+ else {
16250
+ return fontSizeNode;
16251
+ }
16252
+ }
16214
16253
  static getInsertNode(docElement, range, format, value) {
16215
16254
  const element = this.GetFormatNode(format, value);
16216
16255
  element.innerHTML = '​';
@@ -16471,7 +16510,7 @@ class ClearFormat$1 {
16471
16510
  * @hidden
16472
16511
  * @deprecated
16473
16512
  */
16474
- static clear(docElement, endNode, enterAction, selector) {
16513
+ static clear(docElement, endNode, enterAction, selector, command) {
16475
16514
  this.domNode = new DOMNode(endNode, docElement);
16476
16515
  this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
16477
16516
  const nodeSelection = new NodeSelection();
@@ -16481,7 +16520,7 @@ class ClearFormat$1 {
16481
16520
  nodeSelection.getSelectionNodeCollectionBr(range);
16482
16521
  const save = nodeSelection.save(range, docElement);
16483
16522
  let cursorRange = false;
16484
- if (range.collapsed) {
16523
+ if (range.collapsed && command !== 'ClearFormat') {
16485
16524
  cursorRange = true;
16486
16525
  range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
16487
16526
  }
@@ -16735,7 +16774,7 @@ class ClearFormatExec {
16735
16774
  }
16736
16775
  applyClear(e) {
16737
16776
  if (e.subCommand === 'ClearFormat') {
16738
- ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector);
16777
+ ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector, e.subCommand);
16739
16778
  if (e.callBack) {
16740
16779
  e.callBack({
16741
16780
  requestType: e.subCommand,
@@ -19039,6 +19078,8 @@ const IFRAMEHEADER = `
19039
19078
  span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }
19040
19079
  .e-table-rhelper { background-color: #4a90e2;}
19041
19080
  .e-rtl { direction: rtl; }
19081
+ .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden;
19082
+ padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }
19042
19083
  </style>
19043
19084
  </head>`;
19044
19085
  /**
@@ -19256,7 +19297,8 @@ class XhtmlValidation {
19256
19297
  const childEle = ele.childNodes[j];
19257
19298
  if (childEle.nodeType !== 3 && childEle.nodeName !== 'TABLE' && childEle.nodeName !== 'TBODY' &&
19258
19299
  childEle.nodeName !== 'THEAD' && childEle.nodeName !== 'TH' && childEle.nodeName !== 'TR' &&
19259
- childEle.nodeName !== 'TD' && childEle.hasAttribute(attrName)) {
19300
+ childEle.nodeName !== 'TD' && childEle.hasAttribute(attrName) &&
19301
+ !childEle.classList.contains('e-mention-chip')) {
19260
19302
  childEle.removeAttribute(attrName);
19261
19303
  }
19262
19304
  if (childEle.hasChildNodes()) {
@@ -20189,14 +20231,22 @@ class PasteCleanup {
20189
20231
  this.parent.trigger(afterPasteCleanup, { value: value }, (updatedArgs) => {
20190
20232
  value = updatedArgs.value;
20191
20233
  });
20234
+ const tempDivElem = this.parent.createElement('div');
20235
+ tempDivElem.innerHTML = value;
20236
+ const isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
20237
+ !isNullOrUndefined(tempDivElem.querySelector('table'));
20192
20238
  if (this.parent.pasteCleanupSettings.prompt) {
20193
- e.args.preventDefault();
20194
- const tempDivElem = this.parent.createElement('div');
20195
- tempDivElem.innerHTML = value;
20196
- if (tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
20197
- !isNullOrUndefined(tempDivElem.querySelector('table'))) {
20239
+ if (isValueNotEmpty) {
20240
+ e.args.preventDefault();
20198
20241
  this.pasteDialog(value, args);
20199
20242
  }
20243
+ else if (Browser.userAgent.indexOf('Firefox') !== -1) {
20244
+ this.fireFoxImageUpload();
20245
+ }
20246
+ }
20247
+ else if (!isValueNotEmpty && !this.parent.pasteCleanupSettings.plainText &&
20248
+ Browser.userAgent.indexOf('Firefox') !== -1) {
20249
+ this.fireFoxImageUpload();
20200
20250
  }
20201
20251
  else if (this.parent.pasteCleanupSettings.plainText) {
20202
20252
  e.args.preventDefault();
@@ -20212,6 +20262,30 @@ class PasteCleanup {
20212
20262
  }
20213
20263
  }
20214
20264
  }
20265
+ fireFoxImageUpload() {
20266
+ // Timeout 500 is added to capture after default paste image from file manager is completed.
20267
+ setTimeout(() => {
20268
+ if (Browser.userAgent.indexOf('Firefox') !== -1) {
20269
+ let currentFocusNode = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()).startContainer;
20270
+ if (currentFocusNode.nodeName !== '#text') {
20271
+ currentFocusNode = currentFocusNode.childNodes[this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()).startOffset];
20272
+ }
20273
+ if (currentFocusNode.previousSibling.nodeName === 'IMG') {
20274
+ currentFocusNode.previousSibling.classList.add('pasteContent_Img');
20275
+ currentFocusNode.previousSibling.classList.add(CLS_RTE_IMAGE);
20276
+ if (this.parent.insertImageSettings.display === 'inline') {
20277
+ currentFocusNode.previousSibling.classList.add(CLS_IMGINLINE);
20278
+ }
20279
+ else {
20280
+ currentFocusNode.previousSibling.classList.add(CLS_IMGBREAK);
20281
+ }
20282
+ currentFocusNode.previousSibling.classList.add();
20283
+ this.setImageProperties(currentFocusNode.previousSibling);
20284
+ }
20285
+ }
20286
+ this.imgUploading(this.parent.inputElement);
20287
+ }, 500);
20288
+ }
20215
20289
  splitBreakLine(value) {
20216
20290
  const enterSplitText = value.split('\n');
20217
20291
  let contentInnerElem = '';
@@ -20691,24 +20765,7 @@ class PasteCleanup {
20691
20765
  const allImg = clipBoardElem.querySelectorAll('img');
20692
20766
  for (let i = 0; i < allImg.length; i++) {
20693
20767
  allImg[i].classList.add('pasteContent_Img');
20694
- if (this.parent.insertImageSettings.width !== 'auto') {
20695
- allImg[i].setAttribute('width', this.parent.insertImageSettings.width);
20696
- }
20697
- if (this.parent.insertImageSettings.minWidth !== '0' && this.parent.insertImageSettings.minWidth !== 0) {
20698
- allImg[i].style.minWidth = this.parent.insertImageSettings.minWidth.toString();
20699
- }
20700
- if (this.parent.insertImageSettings.maxWidth !== null) {
20701
- allImg[i].style.maxWidth = this.parent.getInsertImgMaxWidth().toString();
20702
- }
20703
- if (this.parent.insertImageSettings.height !== 'auto') {
20704
- allImg[i].setAttribute('height', this.parent.insertImageSettings.height);
20705
- }
20706
- if (this.parent.insertImageSettings.minHeight !== '0' && this.parent.insertImageSettings.minHeight !== 0) {
20707
- allImg[i].style.minHeight = this.parent.insertImageSettings.minHeight.toString();
20708
- }
20709
- if (this.parent.insertImageSettings.maxHeight !== null) {
20710
- allImg[i].style.maxHeight = this.parent.insertImageSettings.maxHeight.toString();
20711
- }
20768
+ this.setImageProperties(allImg[i]);
20712
20769
  }
20713
20770
  this.addTempClass(clipBoardElem);
20714
20771
  if (clipBoardElem.textContent !== '' || !isNullOrUndefined(clipBoardElem.querySelector('img')) ||
@@ -20725,6 +20782,26 @@ class PasteCleanup {
20725
20782
  }
20726
20783
  }
20727
20784
  }
20785
+ setImageProperties(allImg) {
20786
+ if (this.parent.insertImageSettings.width !== 'auto') {
20787
+ allImg.setAttribute('width', this.parent.insertImageSettings.width);
20788
+ }
20789
+ if (this.parent.insertImageSettings.minWidth !== '0' && this.parent.insertImageSettings.minWidth !== 0) {
20790
+ allImg.style.minWidth = this.parent.insertImageSettings.minWidth.toString();
20791
+ }
20792
+ if (this.parent.insertImageSettings.maxWidth !== null) {
20793
+ allImg.style.maxWidth = this.parent.getInsertImgMaxWidth().toString();
20794
+ }
20795
+ if (this.parent.insertImageSettings.height !== 'auto') {
20796
+ allImg.setAttribute('height', this.parent.insertImageSettings.height);
20797
+ }
20798
+ if (this.parent.insertImageSettings.minHeight !== '0' && this.parent.insertImageSettings.minHeight !== 0) {
20799
+ allImg.style.minHeight = this.parent.insertImageSettings.minHeight.toString();
20800
+ }
20801
+ if (this.parent.insertImageSettings.maxHeight !== null) {
20802
+ allImg.style.maxHeight = this.parent.insertImageSettings.maxHeight.toString();
20803
+ }
20804
+ }
20728
20805
  addTempClass(clipBoardElem) {
20729
20806
  const allChild = clipBoardElem.children;
20730
20807
  for (let i = 0; i < allChild.length; i++) {
@@ -26660,7 +26737,7 @@ class Video {
26660
26737
  videoUrl.appendChild(urlContent);
26661
26738
  this.embedInputUrl = this.parent.createElement('textarea', {
26662
26739
  className: 'e-input e-embed-video-url',
26663
- attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
26740
+ attrs: { placeholder: 'Paste Embedded Code here', type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
26664
26741
  });
26665
26742
  this.embedInputUrl.addEventListener('keyup', () => {
26666
26743
  if (!isNullOrUndefined(this.embedInputUrl)) {
@@ -26687,7 +26764,7 @@ class Video {
26687
26764
  }
26688
26765
  });
26689
26766
  const embedUrlBtn = new RadioButton({
26690
- label: 'Embed URL',
26767
+ label: 'Embedded Code',
26691
26768
  checked: true,
26692
26769
  name: 'URL',
26693
26770
  created: () => {
@@ -30437,6 +30514,7 @@ let RichTextEditor = class RichTextEditor extends Component {
30437
30514
  const currentEndContainer = range.endContainer;
30438
30515
  const currentStartOffset = range.startOffset;
30439
30516
  const isSameContainer = currentStartContainer === currentEndContainer ? true : false;
30517
+ const currentEndOffset = currentEndContainer.textContent.length;
30440
30518
  const endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
30441
30519
  range.endContainer;
30442
30520
  const closestLI = closest(endNode, 'LI');
@@ -30549,6 +30627,9 @@ let RichTextEditor = class RichTextEditor extends Component {
30549
30627
  if ((!isNullOrUndefined(this.placeHolderWrapper)) && (this.inputElement.textContent.length !== 1)) {
30550
30628
  this.placeHolderWrapper.style.display = 'none';
30551
30629
  }
30630
+ else if (this.iframeSettings.enable && this.inputElement.classList.contains("e-rte-placeholder")) {
30631
+ removeClass([this.inputElement], "e-rte-placeholder");
30632
+ }
30552
30633
  else {
30553
30634
  this.setPlaceHolder();
30554
30635
  }
@@ -31250,6 +31331,17 @@ let RichTextEditor = class RichTextEditor extends Component {
31250
31331
  this.inputElement.setAttribute('placeholder', this.placeholder);
31251
31332
  }
31252
31333
  }
31334
+ if (this.placeholder && this.iframeSettings.enable) {
31335
+ if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
31336
+ ((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
31337
+ this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
31338
+ addClass([this.inputElement], "e-rte-placeholder");
31339
+ this.inputElement.setAttribute('placeholder', this.placeholder);
31340
+ }
31341
+ else {
31342
+ removeClass([this.inputElement], "e-rte-placeholder");
31343
+ }
31344
+ }
31253
31345
  }
31254
31346
  setWidth(width) {
31255
31347
  if (width !== 'auto') {
@@ -31973,6 +32065,9 @@ let RichTextEditor = class RichTextEditor extends Component {
31973
32065
  clearInterval(this.timeInterval);
31974
32066
  this.timeInterval = null;
31975
32067
  }
32068
+ if (!isNullOrUndefined(this.placeHolderWrapper) && this.element.querySelector('[title = Preview]')) {
32069
+ this.placeHolderWrapper.style.display = "none";
32070
+ }
31976
32071
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
31977
32072
  }
31978
32073
  else {