Skip to content

Commit

Permalink
fix for iOS bug
Browse files Browse the repository at this point in the history
This is the code that fixes issue #130
  • Loading branch information
blairmacintyre authored and jsantell committed Jan 6, 2020
1 parent a51d21c commit 68b8628
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/XRInputSourceEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default class XRInputSourceEvent extends Event {
frame: eventInitDict.frame,
inputSource: eventInitDict.inputSource
};
// safari bug: super() seems to return object of type Event, with Event as prototype
Object.setPrototypeOf(this, XRInputSourceEvent.prototype);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/api/XRInputSourcesChangeEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default class XRInputSourcesChangeEvent extends Event {
added: eventInitDict.added,
removed: eventInitDict.removed
};
// safari bug: super() seems to return object of type Event, with Event as prototype
Object.setPrototypeOf(this, XRInputSourcesChangeEvent.prototype);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/api/XRReferenceSpaceEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default class XRReferenceSpaceEvent extends Event {
referenceSpace: eventInitDict.referenceSpace,
transform: eventInitDict.transform || null
};
// safari bug: super() seems to return object of type Event, with Event as prototype
Object.setPrototypeOf(this, XRReferenceSpaceEvent.prototype);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/api/XRSessionEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default class XRSessionEvent extends Event {
this[PRIVATE] = {
session: eventInitDict.session
};
// safari bug: super() seems to return object of type Event, with Event as prototype
Object.setPrototypeOf(this, XRSessionEvent.prototype);
}

/**
Expand Down

0 comments on commit 68b8628

Please sign in to comment.