Created
May 9, 2012 14:45
-
-
Save shanesmith/2645017 to your computer and use it in GitHub Desktop.
Sencha Touch 1.1.1 Fix for Blackberry OS 7 Field Tap Bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Ext.is.Blackberry) { | |
// Fix BlackBerry OS 7 issue where tapping on | |
// text fields does not give focus | |
Ext.gesture.Manager.onTouchEnd = function(e) { | |
if (this.isFrozen) { | |
return; | |
} | |
var gestures = this.currentGestures.slice(0), | |
ln = gestures.length, | |
i, gesture, endPoint, | |
needsAnotherMove = false, | |
touch = e.changedTouches ? e.changedTouches[0] : e; | |
if (this.startPoint) { | |
endPoint = Ext.util.Point.fromEvent(e); | |
if (!(this.lastMovePoint || this.startPoint)['equals'](endPoint)) { | |
needsAnotherMove = true; | |
} | |
} | |
for (i = 0; i < ln; i++) { | |
gesture = gestures[i]; | |
if (!e.stopped && gesture.listenForEnd) { | |
// The point has changed, we should execute another onTouchMove before onTouchEnd | |
// to deal with the problem of missing events on Androids and alike | |
// This significantly improves scrolling experience on Androids! | |
if (needsAnotherMove) { | |
gesture.onTouchMove(e, touch); | |
} | |
gesture.onTouchEnd(e, touch); | |
} | |
this.stopGesture(gesture); | |
} | |
if (Ext.supports.Touch && this.isClick) { | |
this.isClick = false; | |
this.getEventSimulator().fire('click', this.startEvent.target, touch); | |
} | |
this.lastMovePoint = null; | |
this.followTouches = []; | |
this.startedChangedTouch = false; | |
this.currentTargets = []; | |
this.startEvent = null; | |
this.startPoint = null; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot for posting a fix! Tested with 9860 OS7.0.0.261 works fine! :-)