Skip to content

bugfix for `.keyboard-raycastable' added unsafely #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kylebakerio
Copy link

fixes bug described here and shown here. You can remix that glitch and swap out commented line 193/192 to see the effect of this change there.

Basically:

"".split(",")
// -> [""]
[""].push(".selector")
// -> ["",".selector"]
["",".selector"].join(",")
// -> ",.selector"

raycaster then interprets ",.selector" as a faulty css selector down the line in raycaster.js line 152, here:

      // note: data.objects === ",.selector"
      
      this.el.sceneEl.querySelectorAll(data.objects)

kylebakerio and others added 4 commits December 29, 2020 11:57
fixes bug described [here](supermedium#26 (comment)) and shown [here](). You can remix that glitch and swap out commented line 193/192 to see the effect of this change there. 

Basically:
```
"".split(",")
// -> [""]
[""].push(".selector")
// -> ["",".selector"]
["",".selector"].join(",")
// -> ",.selector"
```
…ta.objects is an array instead of string

fix for error `raycaster.objects.split is not a function`, because this can be an array instead of a string; when I hit the error, I was able to see at that point in execution:
```
console.log(raycaster.data.objects)
//=> ["[gui-interactable]", ".raycastable"]
```
fix for "raycaster.objects.split is not a function" when raycaster.data.objects is an array instead of string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant