smartrte-react 0.2.4 → 0.2.5

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.
@@ -2528,11 +2528,14 @@ export function ClassicEditor({ value, onChange, placeholder = "Type here…", m
2528
2528
  const applyBgToSelection = (hex, fallbackCell) => {
2529
2529
  const sel = shouldUseTableSelection(fallbackCell) ? selectionRef.current : null;
2530
2530
  if (sel) {
2531
- getCellsInGridRect(sel.tbody, sel.sr, sel.sc, sel.er, sel.ec).forEach((cell) => {
2531
+ const cells = getCellsInGridRect(sel.tbody, sel.sr, sel.sc, sel.er, sel.ec);
2532
+ clearSelectionDecor();
2533
+ cells.forEach((cell) => {
2532
2534
  cell.style.background = hex;
2533
2535
  });
2534
2536
  }
2535
2537
  else if (fallbackCell) {
2538
+ clearSelectionDecor();
2536
2539
  fallbackCell.style.background = hex;
2537
2540
  }
2538
2541
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartrte-react",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "A powerful, feature-rich Rich Text Editor for React with support for tables, mathematical formulas (LaTeX/KaTeX), and media management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",