Skip to content

Error in Enter VR / Exit VR Events  #4740

@stefanhuber

Description

@stefanhuber

Description:

Entering VR triggers an error in Firefox in the console (no Error visible in Chrome). However, only the Enter VR Event is triggered. The Exit VR Event is not triggered. The same code snippet works fine with version 1.0.4.

Firefox console output:
grafik

  • A-Frame Version: 1.1.0
  • Platform / Device: Windows 10, Firefox and Chrome
  • Reproducible Code Snippet or URL:
<html>
    <head>
        <script src="https://aframe.io/releases/1.1.0/aframe.min.js"></script>
    </head>
    <body>
        <script>
            AFRAME.registerComponent('toggle', {
                schema: {                    
                },
                init: function() {
                    this.el.addEventListener('enter-vr', () => console.log("enter vr"));
                    this.el.addEventListener('exit-vr', () => console.log("exit vr"));
                }
            });
        </script>    

        <a-scene toggle>            
        </a-scene>
    </body>
</html>

The above snippet works with version 1.0.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions