-
1 Feb 2012 4:39 AM #1
Ext.gesture.Manager.removeEventListener bug?
Ext.gesture.Manager.removeEventListener bug?
Sencha Touch version tested:
- v1.1.1
- Google Chrome
- HTC Incredible S710e with Android 2.3.5
- Ext.gesture.Manager.addEventListener always add new event targets to this.targets (if the target is not there already)
- Ext.gesture.Manager.removeEventListener newer removes event targets from this.targets
- The number of targets in Ext.gesture.Manager.targets will continue to grow for as long as the application is running
- This causes my phone to freeze in a Ext.List if I just repeatedly scroll the list up and down and click in to the item and back to the list (running in PhoneGap - i need to close the app from the Android settings menu when it freezes and there are no error messages in the console)
Code:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="lib/sencha/resources/css/sencha-touch.css" type="text/css"> <script type="text/javascript" src="lib/sencha/sencha-touch-debug-w-comments.js"></script> <script type="text/javascript" src="bug.js"></script> </head> <body></body> </html>Steps to reproduce the problem:Code:Ext.setup({ onReady: function() { Ext.regModel('Contact', { fields: ['firstName', 'lastName'] }); var store = new Ext.data.JsonStore({ model : 'Contact', sorters: 'lastName', getGroupString : function(record) { return record.get('lastName')[0]; }, data: [ {firstName: 'Tommy', lastName: 'Maintz'}, {firstName: 'Rob', lastName: 'Dougan'}, {firstName: 'Ed', lastName: 'Spencer'}, {firstName: 'Jamie', lastName: 'Avins'}, {firstName: 'Aaron', lastName: 'Conran'}, {firstName: 'Dave', lastName: 'Kaneda'}, {firstName: 'Michael', lastName: 'Mullany'}, {firstName: 'Abraham', lastName: 'Elias'}, {firstName: 'Jay', lastName: 'Robinson'} ] }); Ext.reg("listview", Ext.extend(Ext.List, { fullscreen: true, itemTpl : '{firstName} {lastName}', store: store, listeners : { itemtap : function(list, index, element) { var item = mainView.setMainContent({ xtype : "itemview", fullName: element.innerText }); } } })); Ext.reg("itemview", Ext.extend(Ext.Panel, { fullscreen: true, items: [{ xtype: 'panel', html: 'Showing the item!' }, { xtype: 'button', text: 'Back', handler: function() { mainView.setMainContent({ xtype : "listview" }); } }], layout: 'vbox' })); Ext.reg("mainview", Ext.extend(Ext.Panel, { fullscreen : true, layout : 'fit', setMainContent : function(componentConfig) { var me = this; var currentContent = this.getComponent("content"); if (currentContent) { me.remove(currentContent); } if (componentConfig != null) { Ext.applyIf(componentConfig, { id : "content" }); var newContent = Ext.ComponentMgr.create(componentConfig); me.add(newContent); me.doLayout(); } } })); var mainView = Ext.ComponentMgr.create({ xtype : "mainview" }); mainView.setMainContent({ xtype : "listview" }); } });- Click on an item in the list
- Click on the "Back" button
- Ext.gesture.Manager.targets has now been increased by 3 targets
- Add this.targets.remove(target) to Ext.gesture.Manager.removeEventListener
-
1 Feb 2012 9:52 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
Gestures are totally different in ST2 so this bug may not be relavant anymore.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
1 Feb 2012 3:05 PM #3
It is relevant whether you can confirm that it is a bug and that the fix is correct (or we are doing something wrong in the way we use ST1).
ST2 is a preview release and therefore not ready for production.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote