Browse Source

Merge pull request #9766 from RaananW/fixViewer

Fix viewer callback binding
David Catuhe 4 years ago
parent
commit
607fce316f
2 changed files with 5 additions and 1 deletions
  1. 1 1
      Viewer/src/templating/templateManager.ts
  2. 4 0
      dist/preview release/what's new.md

+ 1 - 1
Viewer/src/templating/templateManager.ts

@@ -596,7 +596,7 @@ export class Template {
                             selector = this.parent.tagName;
                         }
                         let binding = functionToFire.bind(this, selector);
-                        this.parent.addEventListener(eventName, functionToFire.bind(this, selector), false);
+                        this.parent.addEventListener(eventName, binding, false);
                         this._registeredEvents.push({
                             htmlElement: this.parent,
                             eventName: eventName,

+ 4 - 0
dist/preview release/what's new.md

@@ -70,6 +70,10 @@
 - Added image tracking feature ([RaananW](https://github.com/RaananW))
 - Pointer Events of WebXR controllers have pointerType `xr` ([RaananW](https://github.com/RaananW))
 
+### Viewer
+
+- Fixed an issue with dual callback binding in case of a forced redraw ([#9608](https://github.com/BabylonJS/Babylon.js/issues/9608)) ([RaananW](https://github.com/RaananW))
+
 ## Bugs
 
 - Fix issue with the Promise polyfill where a return value was expected from resolve() ([Deltakosh](https://github.com/deltakosh))