@alaarab/ogrid-react 2.4.1 → 2.4.2

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.
Files changed (2) hide show
  1. package/dist/esm/index.js +12 -0
  2. package/package.json +2 -2
package/dist/esm/index.js CHANGED
@@ -13004,6 +13004,8 @@ var selectChevronStyle = {
13004
13004
  function BaseInlineCellEditor(props) {
13005
13005
  const { value, column, editorType, onCommit, onCancel, renderCheckbox } = props;
13006
13006
  const wrapperRef = React5.useRef(null);
13007
+ const onCancelRef = React5.useRef(onCancel);
13008
+ onCancelRef.current = onCancel;
13007
13009
  const { localValue, setLocalValue, handleKeyDown, handleBlur, commit, cancel } = useInlineCellEditorState({ value, editorType, onCommit, onCancel });
13008
13010
  const editorValues = column.cellEditorParams?.values ?? [];
13009
13011
  const editorFormatValue = column.cellEditorParams?.formatValue;
@@ -13043,6 +13045,16 @@ function BaseInlineCellEditor(props) {
13043
13045
  boxShadow: "var(--ogrid-shadow, 0 4px 16px rgba(0,0,0,0.2))",
13044
13046
  textAlign: "left"
13045
13047
  });
13048
+ const scrollParent = wrapper.closest(".ogrid-table-wrapper") ?? wrapper.closest('[style*="overflow"]');
13049
+ const handleScroll = () => onCancelRef.current();
13050
+ if (scrollParent) {
13051
+ scrollParent.addEventListener("scroll", handleScroll, { passive: true });
13052
+ }
13053
+ window.addEventListener("scroll", handleScroll, { passive: true });
13054
+ return () => {
13055
+ if (scrollParent) scrollParent.removeEventListener("scroll", handleScroll);
13056
+ window.removeEventListener("scroll", handleScroll);
13057
+ };
13046
13058
  }, [editorType]);
13047
13059
  const computedDropdownStyle = fixedDropdownStyle ?? richSelectDropdownStyle;
13048
13060
  React5.useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-react",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "OGrid React – React hooks, headless components, and utilities for OGrid data grids.",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -39,7 +39,7 @@
39
39
  "node": ">=18"
40
40
  },
41
41
  "dependencies": {
42
- "@alaarab/ogrid-core": "2.4.1",
42
+ "@alaarab/ogrid-core": "2.4.2",
43
43
  "@tanstack/react-virtual": "^3.0.0"
44
44
  },
45
45
  "peerDependencies": {