slate-angular 1.7.3 → 1.7.4

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.
@@ -2178,35 +2178,28 @@
2178
2178
  this.cdr.markForCheck();
2179
2179
  };
2180
2180
  BaseLeafComponent.prototype.renderPlaceholder = function () {
2181
- var _a, _b, _c;
2182
2181
  // issue-1: IME input was interrupted
2183
2182
  // issue-2: IME input focus jumping
2184
- // Issue occurs when the placeholder node is removed (in leaf span)
2185
- // So add a placeholder span to the block element root node
2183
+ // Issue occurs when the span node of the placeholder is before the slateString span node
2186
2184
  if (this.context.leaf['placeholder']) {
2187
2185
  if (!this.placeholderElement) {
2188
2186
  this.placeholderElement = document.createElement('span');
2189
2187
  this.placeholderElement.innerText = this.context.leaf['placeholder'];
2190
2188
  this.placeholderElement.contentEditable = 'false';
2191
2189
  this.placeholderElement.setAttribute('data-slate-placeholder', 'true');
2192
- (_a = this.nativeElement.closest('[data-slate-node="element"]')) === null || _a === void 0 ? void 0 : _a.classList.add('element-placeholder');
2193
- (_b = this.nativeElement.closest('[data-slate-node="element"]')) === null || _b === void 0 ? void 0 : _b.appendChild(this.placeholderElement);
2190
+ this.nativeElement.classList.add('leaf-with-placeholder');
2191
+ this.nativeElement.appendChild(this.placeholderElement);
2194
2192
  }
2195
2193
  }
2196
2194
  else {
2197
- if (this.placeholderElement) {
2198
- this.placeholderElement.remove();
2199
- this.placeholderElement = null;
2200
- (_c = this.nativeElement.closest('[data-slate-node="element"]')) === null || _c === void 0 ? void 0 : _c.classList.remove('element-placeholder');
2201
- }
2195
+ this.destroyPlaceholder();
2202
2196
  }
2203
2197
  };
2204
2198
  BaseLeafComponent.prototype.destroyPlaceholder = function () {
2205
- var _a, _b;
2206
2199
  if (this.placeholderElement) {
2207
2200
  this.placeholderElement.remove();
2208
2201
  this.placeholderElement = null;
2209
- (_b = (_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.closest('[data-slate-node="element"]')) === null || _b === void 0 ? void 0 : _b.classList.remove('element-placeholder');
2202
+ this.nativeElement.classList.remove('leaf-with-placeholder');
2210
2203
  }
2211
2204
  };
2212
2205
  return BaseLeafComponent;