From 230ee6c73acd3f79a92b61ff5e665e7dffd78334 Mon Sep 17 00:00:00 2001 From: Mitchell Lee Date: Fri, 19 Aug 2022 17:38:47 -0500 Subject: [PATCH] Fix issue with selecting objects while panning, addressing previous feedback (#58) Co-authored-by: Mitchell Lee --- packages/scene-composer/package.json | 8 +-- .../src/components/Tree/TreeItem.tsx | 12 ++--- .../SceneHierarchyTreeItem.tsx | 2 +- .../SceneHierarchyTreeItem.spec.tsx.snap | 2 +- .../__tests__/SubModelTree.spec.tsx | 8 +-- .../components/SubModelTree/index.tsx | 22 ++++---- .../__tests__/EntityGroup.spec.tsx | 52 ++++--------------- .../three-fiber/EntityGroup/index.tsx | 37 +++++++------ .../EntityGroup/useCallbackWhenNotPanning.ts | 47 +++++++++++++++++ 9 files changed, 103 insertions(+), 87 deletions(-) create mode 100644 packages/scene-composer/src/components/three-fiber/EntityGroup/useCallbackWhenNotPanning.ts diff --git a/packages/scene-composer/package.json b/packages/scene-composer/package.json index db0150957..c60e3edcd 100644 --- a/packages/scene-composer/package.json +++ b/packages/scene-composer/package.json @@ -151,10 +151,10 @@ "jest": { "coverageThreshold": { "global": { - "lines": 76.85, - "statements": 75.98, - "functions": 75.29, - "branches": 62.1, + "lines": 76.64, + "statements": 75.77, + "functions": 75.05, + "branches": 61.93, "branchesTrue": 100 } } diff --git a/packages/scene-composer/src/components/Tree/TreeItem.tsx b/packages/scene-composer/src/components/Tree/TreeItem.tsx index 57661f6de..3a5d23448 100644 --- a/packages/scene-composer/src/components/Tree/TreeItem.tsx +++ b/packages/scene-composer/src/components/Tree/TreeItem.tsx @@ -81,13 +81,11 @@ const TreeItem = React.forwardRef( > {expandable && ( - <> -