Remove tree view nav with left and right arrow keys in project manager and events function list (#6396)

This commit is contained in:
AlexandreS
2024-02-28 13:53:30 +01:00
committed by GitHub
parent 12a6fec18e
commit 649d744664
2 changed files with 0 additions and 54 deletions

View File

@@ -1096,32 +1096,6 @@ const EventsFunctionsList = React.forwardRef<
...behaviorTreeViewItems.map(item => item.content.getId()),
];
const arrowKeyNavigationProps = React.useMemo(
() => ({
onGetItemInside: item => {
if (item.isPlaceholder || item.isRoot) return null;
if (!item.objectFolderOrObject.isFolder()) return null;
else {
if (item.objectFolderOrObject.getChildrenCount() === 0) return null;
return {
objectFolderOrObject: item.objectFolderOrObject.getChildAt(0),
global: item.global,
};
}
},
onGetItemOutside: item => {
if (item.isPlaceholder || item.isRoot) return null;
const parent = item.objectFolderOrObject.getParent();
if (parent.isRootFolder()) return null;
return {
objectFolderOrObject: parent,
global: item.global,
};
},
}),
[]
);
React.useEffect(
() => {
// TODO Use a map from itemId to item to avoid to rebuild the item.
@@ -1237,7 +1211,6 @@ const EventsFunctionsList = React.forwardRef<
canMoveSelectionToItem={canMoveSelectionTo}
reactDndType={extensionItemReactDndType}
initiallyOpenedNodeIds={initiallyOpenedNodeIds}
arrowKeyNavigationProps={arrowKeyNavigationProps}
forceDefaultDraggingPreview
shouldHideMenuIcon={() => true}
/>

View File

@@ -1226,32 +1226,6 @@ const ProjectManager = React.forwardRef<Props, ProjectManagerInterface>(
externalLayoutsRootFolderId,
];
const arrowKeyNavigationProps = React.useMemo(
() => ({
onGetItemInside: item => {
if (item.isPlaceholder || item.isRoot) return null;
if (!item.objectFolderOrObject.isFolder()) return null;
else {
if (item.objectFolderOrObject.getChildrenCount() === 0) return null;
return {
objectFolderOrObject: item.objectFolderOrObject.getChildAt(0),
global: item.global,
};
}
},
onGetItemOutside: item => {
if (item.isPlaceholder || item.isRoot) return null;
const parent = item.objectFolderOrObject.getParent();
if (parent.isRootFolder()) return null;
return {
objectFolderOrObject: parent,
global: item.global,
};
},
}),
[]
);
return (
<Background maxWidth>
<ProjectManagerCommands
@@ -1324,7 +1298,6 @@ const ProjectManager = React.forwardRef<Props, ProjectManagerInterface>(
canMoveSelectionToItem={canMoveSelectionTo}
reactDndType={extensionItemReactDndType}
initiallyOpenedNodeIds={initiallyOpenedNodeIds}
arrowKeyNavigationProps={arrowKeyNavigationProps}
forceDefaultDraggingPreview
shouldHideMenuIcon={item => !item.content.getRootId()}
/>