Skip to content

Commit

Permalink
Disable pointer events on everything to let it through to the iframe …
Browse files Browse the repository at this point in the history
…source page.
  • Loading branch information
namark committed Apr 11, 2024
1 parent f140a44 commit 7eff0b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html style="pointer-events:none;">
<head>
<title><%= process.env.VRCA_PRODUCT_NAME %></title>

Expand Down
8 changes: 3 additions & 5 deletions src/modules/scene/css3DRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export class CSS3DObject {
constructor(element: HTMLElement, mesh: AbstractMesh) {
this._element = element;
this._element.style.position = "absolute";
this._element.style.pointerEvents = "auto";
this._element.style.pointerEvents = "none";
this._element.children[0].style.pointerEvents = "none"; // disable input on iframe tag

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / desktop-build (macos-latest)

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / 🎉 Deploy

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / ⚒️ Build

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / desktop-build (ubuntu-20.04)

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / desktop-build (windows-latest)

Unsafe member access .pointerEvents on an `any` value

this._mesh = mesh;
this._mesh.onDisposeObservable.add(() => {
Expand All @@ -45,10 +46,7 @@ export class CSS3DObject {
this._renderer = Renderer.getScene().css3DRenderer as CSS3DRenderer;
this._renderer.addCSS3DObject(this);

// this._element.addEventListener("mouseout", this._renderer.detachControl.bind(this));
this._element.addEventListener("pointerdown", (event: PointerEvent) => {
event.stopPropagation();
});
this._element.addEventListener("mouseout", this._renderer.detachControl.bind(this));
}

public get mesh(): AbstractMesh {
Expand Down

0 comments on commit 7eff0b4

Please sign in to comment.