@handsontable/react-wrapper 0.0.0-next-b8ddec2-20260506 → 0.0.0-next-aaa8ee1-20260507

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.
@@ -355,11 +355,18 @@ function createPortal(rElement) {
355
355
  if (!ownerDocument) {
356
356
  ownerDocument = document;
357
357
  }
358
- if (!bulkComponentContainer) {
359
- bulkComponentContainer = ownerDocument.createDocumentFragment();
358
+ var portalContainer = cachedContainer;
359
+
360
+ // A new container needs an anchor before React mounts into it. A cached
361
+ // container is already attached (typically inside its TD) and must be
362
+ // left in place to avoid wiping the DOM on every grid render.
363
+ if (!portalContainer) {
364
+ if (!bulkComponentContainer) {
365
+ bulkComponentContainer = ownerDocument.createDocumentFragment();
366
+ }
367
+ portalContainer = ownerDocument.createElement('DIV');
368
+ bulkComponentContainer.appendChild(portalContainer);
360
369
  }
361
- var portalContainer = cachedContainer !== null && cachedContainer !== void 0 ? cachedContainer : ownerDocument.createElement('DIV');
362
- bulkComponentContainer.appendChild(portalContainer);
363
370
  return {
364
371
  portal: /*#__PURE__*/ReactDOM__default["default"].createPortal(rElement, portalContainer, portalKey),
365
372
  portalContainer: portalContainer
@@ -553,38 +560,36 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
553
560
  var instanceGuid = instance.guid;
554
561
  var portalContainerKey = "".concat(instanceGuid, "-").concat(key);
555
562
  var portalKey = "".concat(key, "-").concat(instanceGuid);
556
- if (renderedCellCache.current.has(key)) {
557
- TD.innerHTML = renderedCellCache.current.get(key).innerHTML;
558
- }
559
563
  if (TD && !TD.getAttribute('ghost-table')) {
560
- var cachedPortal = portalCache.current.get(portalKey);
561
564
  var cachedPortalContainer = portalContainerCache.current.get(portalContainerKey);
562
- while (TD.firstChild) {
563
- TD.removeChild(TD.firstChild);
564
- }
565
-
566
- // if portal already exists, do not recreate
567
- if (cachedPortal && cachedPortalContainer) {
568
- TD.appendChild(cachedPortalContainer);
569
- } else {
570
- var rendererElement = /*#__PURE__*/React__default["default"].createElement(Renderer, {
571
- instance: instance,
572
- TD: TD,
573
- row: row,
574
- col: col,
575
- prop: prop,
576
- value: value,
577
- cellProperties: cellProperties
578
- });
579
- var _createPortal = createPortal(rendererElement, TD.ownerDocument, portalKey, cachedPortalContainer),
580
- portal = _createPortal.portal,
581
- portalContainer = _createPortal.portalContainer;
582
- portalContainerCache.current.set(portalContainerKey, portalContainer);
565
+ // When the cached portal container is still attached to the same
566
+ // TD as the previous render, the DOM is already correct and must
567
+ // not be wiped. Wiping detaches the React-managed children, which
568
+ // forces a full remount of the renderer component on every grid
569
+ // render (see issue #10800).
570
+ var containerInPlace = !!cachedPortalContainer && cachedPortalContainer.parentNode === TD;
571
+ var rendererElement = /*#__PURE__*/React__default["default"].createElement(Renderer, {
572
+ instance: instance,
573
+ TD: TD,
574
+ row: row,
575
+ col: col,
576
+ prop: prop,
577
+ value: value,
578
+ cellProperties: cellProperties
579
+ });
580
+ var _createPortal = createPortal(rendererElement, TD.ownerDocument, portalKey, cachedPortalContainer),
581
+ portal = _createPortal.portal,
582
+ portalContainer = _createPortal.portalContainer;
583
+ if (!containerInPlace) {
584
+ while (TD.firstChild) {
585
+ TD.removeChild(TD.firstChild);
586
+ }
583
587
  TD.appendChild(portalContainer);
584
- portalCache.current.set(portalKey, portal);
585
588
  }
589
+ portalContainerCache.current.set(portalContainerKey, portalContainer);
590
+ portalCache.current.set(portalKey, portal);
586
591
  }
587
- renderedCellCache.current.set("".concat(row, "-").concat(col), TD);
592
+ renderedCellCache.current.set(key, TD);
588
593
  return TD;
589
594
  };
590
595
  }, []);
@@ -1074,7 +1079,7 @@ var HotColumn = function HotColumn(props) {
1074
1079
  }, editorPortal);
1075
1080
  };
1076
1081
 
1077
- var version="0.0.0-next-b8ddec2-20260506";
1082
+ var version="0.0.0-next-aaa8ee1-20260507";
1078
1083
 
1079
1084
  /**
1080
1085
  * Component used to manage the renderer component portals.
@@ -25,7 +25,7 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-b8ddec2-20260506 (built at Wed May 06 2026 10:18:16 GMT+0000 (Coordinated Universal Time))
28
+ * Version: 0.0.0-next-aaa8ee1-20260507 (built at Thu May 07 2026 06:37:47 GMT+0000 (Coordinated Universal Time))
29
29
  */
30
30
  (function (global, factory) {
31
31
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('handsontable/base'), require('handsontable/renderers/registry'), require('handsontable/editors/registry')) :
@@ -380,11 +380,18 @@ function createPortal(rElement) {
380
380
  if (!ownerDocument) {
381
381
  ownerDocument = document;
382
382
  }
383
- if (!bulkComponentContainer) {
384
- bulkComponentContainer = ownerDocument.createDocumentFragment();
383
+ var portalContainer = cachedContainer;
384
+
385
+ // A new container needs an anchor before React mounts into it. A cached
386
+ // container is already attached (typically inside its TD) and must be
387
+ // left in place to avoid wiping the DOM on every grid render.
388
+ if (!portalContainer) {
389
+ if (!bulkComponentContainer) {
390
+ bulkComponentContainer = ownerDocument.createDocumentFragment();
391
+ }
392
+ portalContainer = ownerDocument.createElement('DIV');
393
+ bulkComponentContainer.appendChild(portalContainer);
385
394
  }
386
- var portalContainer = cachedContainer !== null && cachedContainer !== void 0 ? cachedContainer : ownerDocument.createElement('DIV');
387
- bulkComponentContainer.appendChild(portalContainer);
388
395
  return {
389
396
  portal: /*#__PURE__*/ReactDOM__default["default"].createPortal(rElement, portalContainer, portalKey),
390
397
  portalContainer: portalContainer
@@ -578,38 +585,36 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
578
585
  var instanceGuid = instance.guid;
579
586
  var portalContainerKey = "".concat(instanceGuid, "-").concat(key);
580
587
  var portalKey = "".concat(key, "-").concat(instanceGuid);
581
- if (renderedCellCache.current.has(key)) {
582
- TD.innerHTML = renderedCellCache.current.get(key).innerHTML;
583
- }
584
588
  if (TD && !TD.getAttribute('ghost-table')) {
585
- var cachedPortal = portalCache.current.get(portalKey);
586
589
  var cachedPortalContainer = portalContainerCache.current.get(portalContainerKey);
587
- while (TD.firstChild) {
588
- TD.removeChild(TD.firstChild);
589
- }
590
-
591
- // if portal already exists, do not recreate
592
- if (cachedPortal && cachedPortalContainer) {
593
- TD.appendChild(cachedPortalContainer);
594
- } else {
595
- var rendererElement = /*#__PURE__*/React__default["default"].createElement(Renderer, {
596
- instance: instance,
597
- TD: TD,
598
- row: row,
599
- col: col,
600
- prop: prop,
601
- value: value,
602
- cellProperties: cellProperties
603
- });
604
- var _createPortal = createPortal(rendererElement, TD.ownerDocument, portalKey, cachedPortalContainer),
605
- portal = _createPortal.portal,
606
- portalContainer = _createPortal.portalContainer;
607
- portalContainerCache.current.set(portalContainerKey, portalContainer);
590
+ // When the cached portal container is still attached to the same
591
+ // TD as the previous render, the DOM is already correct and must
592
+ // not be wiped. Wiping detaches the React-managed children, which
593
+ // forces a full remount of the renderer component on every grid
594
+ // render (see issue #10800).
595
+ var containerInPlace = !!cachedPortalContainer && cachedPortalContainer.parentNode === TD;
596
+ var rendererElement = /*#__PURE__*/React__default["default"].createElement(Renderer, {
597
+ instance: instance,
598
+ TD: TD,
599
+ row: row,
600
+ col: col,
601
+ prop: prop,
602
+ value: value,
603
+ cellProperties: cellProperties
604
+ });
605
+ var _createPortal = createPortal(rendererElement, TD.ownerDocument, portalKey, cachedPortalContainer),
606
+ portal = _createPortal.portal,
607
+ portalContainer = _createPortal.portalContainer;
608
+ if (!containerInPlace) {
609
+ while (TD.firstChild) {
610
+ TD.removeChild(TD.firstChild);
611
+ }
608
612
  TD.appendChild(portalContainer);
609
- portalCache.current.set(portalKey, portal);
610
613
  }
614
+ portalContainerCache.current.set(portalContainerKey, portalContainer);
615
+ portalCache.current.set(portalKey, portal);
611
616
  }
612
- renderedCellCache.current.set("".concat(row, "-").concat(col), TD);
617
+ renderedCellCache.current.set(key, TD);
613
618
  return TD;
614
619
  };
615
620
  }, []);
@@ -1099,7 +1104,7 @@ var HotColumn = function HotColumn(props) {
1099
1104
  }, editorPortal);
1100
1105
  };
1101
1106
 
1102
- var version="0.0.0-next-b8ddec2-20260506";
1107
+ var version="0.0.0-next-aaa8ee1-20260507";
1103
1108
 
1104
1109
  /**
1105
1110
  * Component used to manage the renderer component portals.