@topconsultnpm/sdkui-react 6.22.0-dev4.2 → 6.22.0-dev4.3

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.
@@ -1404,12 +1404,14 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
1404
1404
  const gridSelection = useMemo(() => ({ mode: allowMultipleSelection ? 'multiple' : 'single' }), [allowMultipleSelection]);
1405
1405
  const useNativeScrollbar = SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1;
1406
1406
  // Con pagine grandi (oltre la soglia impostata, default 500 righe) il rendering virtuale delle righe evita di creare nel DOM tutte le righe della pagina.
1407
+ // Conta le righe effettive della pagina, non pageSize: con pochi risultati la griglia resta in rendering standard.
1407
1408
  const virtualRenderingThreshold = SDKUI_Globals.userSettings.searchSettings?.virtualRenderingThreshold ?? DEFAULT_VIRTUAL_RENDERING_THRESHOLD;
1409
+ const pageRowCount = Math.min(pageSize, dataSource?.length ?? 0);
1408
1410
  const gridScrolling = useMemo(() => ({
1409
1411
  columnRenderingMode: 'virtual',
1410
- rowRenderingMode: pageSize > virtualRenderingThreshold ? 'virtual' : 'standard',
1412
+ rowRenderingMode: pageRowCount > virtualRenderingThreshold ? 'virtual' : 'standard',
1411
1413
  useNative: useNativeScrollbar
1412
- }), [useNativeScrollbar, pageSize, virtualRenderingThreshold]);
1414
+ }), [useNativeScrollbar, pageRowCount, virtualRenderingThreshold]);
1413
1415
  // Handles selection change in the data grid
1414
1416
  const handleSelectionChange = useCallback((e) => {
1415
1417
  if (onSelectionChanged === undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.22.0-dev4.2",
3
+ "version": "6.22.0-dev4.3",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" \u0026\u0026 exit 1",