From 97a4326f22b62e4e7e9118c90d1e5bebcc5d49e5 Mon Sep 17 00:00:00 2001 From: matttdawson <89495499+matttdawson@users.noreply.github.com> Date: Thu, 23 May 2024 12:17:37 +1200 Subject: [PATCH 1/2] FEATURE: add colId to popover grid context --- src/contexts/GridPopoverContext.tsx | 2 ++ src/contexts/GridPopoverContextProvider.tsx | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/contexts/GridPopoverContext.tsx b/src/contexts/GridPopoverContext.tsx index 299b871a..e3eadb08 100644 --- a/src/contexts/GridPopoverContext.tsx +++ b/src/contexts/GridPopoverContext.tsx @@ -6,6 +6,7 @@ export interface GridPopoverContextType { anchorRef: RefObject; saving: boolean; setSaving: (saving: boolean) => void; + colId: string; field: keyof TData; value: any; data: TData; @@ -18,6 +19,7 @@ export const GridPopoverContext = createContext>({ anchorRef: { current: null }, saving: false, setSaving: () => {}, + colId: "", field: "", value: null, data: {} as GridBaseRow, diff --git a/src/contexts/GridPopoverContextProvider.tsx b/src/contexts/GridPopoverContextProvider.tsx index f7c1b0b9..28915a7a 100644 --- a/src/contexts/GridPopoverContextProvider.tsx +++ b/src/contexts/GridPopoverContextProvider.tsx @@ -26,7 +26,9 @@ export const GridPopoverContextProvider = ({ props, children }: PropsWithChildre multiEdit ? sortBy(getFilteredSelectedRows(), (row) => row.id !== props.data.id) : [props.data as GridBaseRow], [getFilteredSelectedRows, multiEdit, props.data], ); + const field = props.colDef?.field ?? ""; + const colId = props.colDef?.colId ?? field ?? ""; const updateValue = useCallback( async (saveFn: (selectedRows: any[]) => Promise, tabDirection: 1 | 0 | -1): Promise => { @@ -44,6 +46,7 @@ export const GridPopoverContextProvider = ({ props, children }: PropsWithChildre saving, setSaving, selectedRows, + colId, field, data: props.data, value: props.value, From aa6971a353490bd15f15f3f428a85e5a49890905 Mon Sep 17 00:00:00 2001 From: matttdawson <89495499+matttdawson@users.noreply.github.com> Date: Thu, 23 May 2024 12:30:47 +1200 Subject: [PATCH 2/2] feat: trigger release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ba2af00..55a3d85d 100644 --- a/README.md +++ b/README.md @@ -277,4 +277,4 @@ This will throw an exception if the row id is not found. ```tsx window.__stepAgGrid.grids[dataTestId].scrollRowIntoViewById("1000") -``` +``` \ No newline at end of file