Skip to content

Commit

Permalink
Work
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Aug 14, 2024
1 parent 0e3e43b commit e7d40dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const useTreeViewVirtualization: TreeViewPlugin<UseTreeViewVirtualization

const itemsToRenderWithVisibleContent = new Set(itemsToRender);

const addItem = (itemId: TreeViewItemId | null) => {
const addItem = (itemId: TreeViewItemId | null | undefined) => {
if (itemId == null || itemsToRenderWithVisibleContent.has(itemId)) {
return;
}
Expand All @@ -168,6 +168,7 @@ export const useTreeViewVirtualization: TreeViewPlugin<UseTreeViewVirtualization
};

addItem(state.focusedItemId);
addItem(state.itemsReordering?.draggedItemId);

const getPropsFromItemId = (
id: TreeViewItemId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
UseTreeViewExpansionSignature,
UseTreeViewFocusSignature,
} from '@mui/x-tree-view/internals';
import { UseTreeViewItemsReorderingSignature } from '../useTreeViewItemsReordering';

export interface UseTreeViewVirtualizationInstance {
getDimensions: () => UseTreeViewVirtualizationState['virtualization'];
Expand Down Expand Up @@ -96,4 +97,5 @@ export type UseTreeViewVirtualizationSignature = TreeViewPluginSignature<{
UseTreeViewExpansionSignature,
UseTreeViewFocusSignature,
];
optionalDependencies: [UseTreeViewItemsReorderingSignature];
}>;

0 comments on commit e7d40dd

Please sign in to comment.