mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Remove tree view nav with left and right arrow keys in project manager and events function list (#6396)
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
|
@@ -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()}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user