Sochettra / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Focus Events Have Memory Leak #284

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add console.log("focus") to start of _onFocus function
2. Click between 2 nodes in dynatree
3. Notice the number of log messages increases each time you change focus

Detected in version 1.2.0 in Chrome (win7)

To fix, update the code immediately after the __focusHandler function as 
follows:

var div = this.tree.divTree;
if (!this.hasBound) {
  if ( div.addEventListener ) {
    div.addEventListener("focus", __focusHandler, true);
    div.addEventListener("blur", __focusHandler, true);
  } else {
    div.onfocusin = div.onfocusout = __focusHandler;
  }
  this.hasBound = true;
}

Original issue reported on code.google.com by peter.do...@ddrit.com on 22 Feb 2012 at 6:28

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 22 Feb 2012 at 6:56

GoogleCodeExporter commented 8 years ago
This would mean that bind() was called on every click.
I tried it with a sample from the demos, and it looked ok.
Could you send a test file, that reproduces it?

Original comment by moo...@wwwendt.de on 9 Jun 2012 at 7:49

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 16 Jun 2012 at 9:51

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 6 Oct 2012 at 9:31

GoogleCodeExporter commented 8 years ago
Closing 'Waiting' issues without timely answer

Original comment by moo...@wwwendt.de on 6 Oct 2013 at 2:09

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 3 May 2014 at 4:37