Skip to content

Commit

Permalink
Merge pull request #384 from makimenko/373-raycaster-fix
Browse files Browse the repository at this point in the history
#373: Raycaster breaks inputs or forms bindings (due to preventDefault)
  • Loading branch information
makimenko authored May 3, 2021
2 parents f2c1800 + 9368ba1 commit 3afea69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion projects/atft/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atft",
"version": "1.4.21",
"version": "1.4.22",
"description": "Ready-to-use Angular components for Three.js, see https://makimenko.github.io/angular-template-for-threejs/.",
"keywords": [
"threejs",
Expand Down
6 changes: 3 additions & 3 deletions projects/atft/src/lib/raycaster/raycaster.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class RaycasterService implements OnDestroy {
if (!this.isReady()) {
return;
}
event.preventDefault();
// #373: removed: event.preventDefault();
const i = this.getFirstIntersectedGroup(event.layerX, event.layerY);
if (!this.selected || this.selected !== i.object) {
if (this.selected) {
Expand All @@ -99,7 +99,7 @@ export class RaycasterService implements OnDestroy {
if (!this.isReady(true)) {
return;
}
event.preventDefault();
// #373: removed: event.preventDefault();
const i = this.getFirstIntersectedGroup(event.layerX, event.layerY);
if (i && i.object) {
i.object.dispatchEvent({type: RaycasterEvent.click, face: i.face});
Expand All @@ -111,7 +111,7 @@ export class RaycasterService implements OnDestroy {
if (!this.isReady()) {
return;
}
event.preventDefault();
// #373: removed: event.preventDefault();
const i = this.getFirstIntersectedGroup(event.touches[0].clientX, event.touches[0].clientY);
if (i && i.object) {
i.object.dispatchEvent({type: RaycasterEvent.click, face: i.face});
Expand Down

0 comments on commit 3afea69

Please sign in to comment.