From 89bd69bf4487b4fb9df5861f9b6745f8d89abce6 Mon Sep 17 00:00:00 2001
From: Michael Dougall <6801309+itsdouges@users.noreply.github.com>
Date: Tue, 6 Aug 2024 06:06:00 +1000
Subject: [PATCH] Fix invisible object selection
adeira-source-id: 16117f1a852b2fdf32c4d9e0068cb5142a0de924
---
.changeset/blue-rabbits-sort.md | 5 ++++
.changeset/dirty-snails-invent.md | 5 ++++
examples/test-fixture/src/third-party.tsx | 11 ++++++++
examples/test-fixture/src/uikit.tsx | 19 ++++++-------
examples/test-fixture/src/visibility.tsx | 33 +++++++++++++++++++++++
examples/test-fixture/tsconfig.json | 2 +-
6 files changed, 65 insertions(+), 10 deletions(-)
create mode 100644 .changeset/blue-rabbits-sort.md
create mode 100644 .changeset/dirty-snails-invent.md
create mode 100644 examples/test-fixture/src/third-party.tsx
create mode 100644 examples/test-fixture/src/visibility.tsx
diff --git a/.changeset/blue-rabbits-sort.md b/.changeset/blue-rabbits-sort.md
new file mode 100644
index 00000000..a1071150
--- /dev/null
+++ b/.changeset/blue-rabbits-sort.md
@@ -0,0 +1,5 @@
+---
+"@triplex/renderer-r3f": patch
+---
+
+Invisible scene objects can no longer be selected in the scene.
diff --git a/.changeset/dirty-snails-invent.md b/.changeset/dirty-snails-invent.md
new file mode 100644
index 00000000..3c3ce573
--- /dev/null
+++ b/.changeset/dirty-snails-invent.md
@@ -0,0 +1,5 @@
+---
+"@triplex/renderer-r3f": patch
+---
+
+You can now unselect by clicking on empty space.
diff --git a/examples/test-fixture/src/third-party.tsx b/examples/test-fixture/src/third-party.tsx
new file mode 100644
index 00000000..159b809d
--- /dev/null
+++ b/examples/test-fixture/src/third-party.tsx
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Michael Dougall. All rights reserved.
+ *
+ * This source code is licensed under the GPL-3.0 license found in the LICENSE
+ * file in the root directory of this source tree.
+ */
+import { Box } from "@react-three/drei";
+
+export const ThirdParty = () => {
+ return ;
+};
diff --git a/examples/test-fixture/src/uikit.tsx b/examples/test-fixture/src/uikit.tsx
index 39dd3410..59eb3b6e 100644
--- a/examples/test-fixture/src/uikit.tsx
+++ b/examples/test-fixture/src/uikit.tsx
@@ -4,17 +4,18 @@
* This source code is licensed under the GPL-3.0 license found in the LICENSE
* file in the root directory of this source tree.
*/
-import { Container, Fullscreen } from "@react-three/uikit";
+import { Container, Portal, Root } from "@react-three/uikit";
export function UIKitExample() {
return (
-
-
-
+
+
+
+
+
+
+
+
+
);
}
diff --git a/examples/test-fixture/src/visibility.tsx b/examples/test-fixture/src/visibility.tsx
new file mode 100644
index 00000000..f90454f8
--- /dev/null
+++ b/examples/test-fixture/src/visibility.tsx
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) Michael Dougall. All rights reserved.
+ *
+ * This source code is licensed under the GPL-3.0 license found in the LICENSE
+ * file in the root directory of this source tree.
+ */
+export function InvisibleMesh() {
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+}
+
+export function InvisibleParent() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/examples/test-fixture/tsconfig.json b/examples/test-fixture/tsconfig.json
index 1e92b58a..f3d0341c 100644
--- a/examples/test-fixture/tsconfig.json
+++ b/examples/test-fixture/tsconfig.json
@@ -8,7 +8,7 @@
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "es2022"],
"module": "esnext",
- "moduleResolution": "node",
+ "moduleResolution": "Bundler",
"noEmit": true,
"paths": {
"@/*": ["./src/*"]