Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/imodel-browser-react",
"comment": "Fix iModelGrid Filtering via postProcessCallback to Show Complete Results Across All Data",
"type": "patch"
}
],
"packageName": "@itwin/imodel-browser-react"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { _mergeStrings } from "../../utils/_apiOverrides";
import { ContextMenuBuilderItem } from "../../utils/_buildMenuOptions";
import { IModelGhostTile } from "../iModelTiles/IModelGhostTile";
import { IModelTile, IModelTileProps } from "../iModelTiles/IModelTile";
import { useIModelData } from "./useIModelData";
import { DEFAULT_PAGE_SIZE, useIModelData } from "./useIModelData";
import { useIModelTableConfig } from "./useIModelTableConfig";
export interface IModelGridProps {
/**
Expand Down Expand Up @@ -173,6 +173,16 @@ export const IModelGrid = ({
[postProcessCallback, fetchediModels, fetchStatus, searchText]
);

React.useEffect(() => {
Comment thread
aruniverse marked this conversation as resolved.
if (
iModels.length < (pageSize ?? DEFAULT_PAGE_SIZE) &&
fetchMore &&
fetchStatus !== DataStatus.Fetching
) {
fetchMore();
}
}, [iModels.length, pageSize, fetchMore, fetchStatus]);
Comment thread
ben-polinsky marked this conversation as resolved.
Comment thread
ben-polinsky marked this conversation as resolved.

const { columns, onRowClick } = useIModelTableConfig({
iModelActions,
onThumbnailClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface IModelDataHookOptions {
/** @deprecated in 2.1 It is no longer used as it has no effect on the data fetching. */
viewMode?: ViewType;
}
const DEFAULT_PAGE_SIZE = 100;
export const DEFAULT_PAGE_SIZE = 100;

export const useIModelData = ({
iTwinId,
Expand Down