fix(grid): reset column filter offset on open
This commit is contained in:
2 files changed
+5
No files matched your search
@@ -1235,6 +1235,9 @@ const localColumnFilterRuntime = useDataGridColumnFilters({
|
|||||||
waitForTableMeta,
|
waitForTableMeta,
|
||||||
applyWhereFilter,
|
applyWhereFilter,
|
||||||
resetGridVerticalScroll: () => resetLocalFilterGridScroll(),
|
resetGridVerticalScroll: () => resetLocalFilterGridScroll(),
|
||||||
|
onOpen: () => {
|
||||||
|
localFilterPopoverOffsetX.value = 0;
|
||||||
|
},
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
onLocalFilterResizeEnd();
|
onLocalFilterResizeEnd();
|
||||||
localFilterPopoverOffsetX.value = 0;
|
localFilterPopoverOffsetX.value = 0;
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export interface UseDataGridColumnFiltersOptions {
|
|||||||
waitForTableMeta: () => Promise<TableMetadata | null>;
|
waitForTableMeta: () => Promise<TableMetadata | null>;
|
||||||
applyWhereFilter: () => Promise<void>;
|
applyWhereFilter: () => Promise<void>;
|
||||||
resetGridVerticalScroll: () => void;
|
resetGridVerticalScroll: () => void;
|
||||||
|
onOpen?: () => void;
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
emitLocalFiltersChange: (filters: Record<string, string[]>) => void;
|
emitLocalFiltersChange: (filters: Record<string, string[]>) => void;
|
||||||
}
|
}
|
||||||
@@ -170,6 +171,7 @@ export function useDataGridColumnFilters(options: UseDataGridColumnFiltersOption
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openLocalFilter(columnIndex: number, requestedMode: DataGridLocalFilterMode = "local") {
|
function openLocalFilter(columnIndex: number, requestedMode: DataGridLocalFilterMode = "local") {
|
||||||
|
options.onOpen?.();
|
||||||
state.localFilterSearch.value = "";
|
state.localFilterSearch.value = "";
|
||||||
const mode = requestedMode === "server" && options.canUseServerColumnFilter.value ? "server" : "local";
|
const mode = requestedMode === "server" && options.canUseServerColumnFilter.value ? "server" : "local";
|
||||||
const allKeys = mode === "server" ? [] : buildLocalFilterOptions(columnIndex).map((option) => option.key);
|
const allKeys = mode === "server" ? [] : buildLocalFilterOptions(columnIndex).map((option) => option.key);
|
||||||
|
|||||||
Reference in new issue
Block a user