-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-9354] Fixed bug with events firing twice. Also fixed a bug with Ti.UI.Slider #2337
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,14 @@ define(["Ti/_/declare", "Ti/_/lang","Ti/_/Gestures/GestureRecognizer"], function | |
|
||
processTouchMoveEvent: function(e, element){ | ||
if (!element._isGestureBlocked(this.name)) { | ||
for (var i = 0; i < e.changedTouches.length; i++) { | ||
element,element._handleTouchEvent(this.name,{ | ||
x: e.changedTouches[i].clientX, | ||
y: e.changedTouches[i].clientY, | ||
source: this.getSourceNode(e,element) | ||
var changed = e.changedTouches, | ||
i = 0, | ||
l = changed.length; | ||
for (; i < l; i++) { | ||
element._handleTouchEvent(this.name, { | ||
x: changed[i].clientX, | ||
y: changed[i].clientY, | ||
source: this.getSourceNode(e, element) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cache source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
}); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
define(["Ti/_/declare", "Ti/_/lang","Ti/_/Gestures/GestureRecognizer"], function(declare,lang,GestureRecognizer) { | ||
define(["Ti/_/declare", "Ti/_/lang", "Ti/_/Gestures/GestureRecognizer"], function(declare,lang,GestureRecognizer) { | ||
|
||
return declare("Ti._.Gestures.TouchStart", GestureRecognizer, { | ||
|
||
name: "touchstart", | ||
|
||
processTouchStartEvent: function(e, element){ | ||
if (!element._isGestureBlocked(this.name)) { | ||
for (var i = 0; i < e.changedTouches.length; i++) { | ||
element,element._handleTouchEvent(this.name,{ | ||
x: e.changedTouches[i].clientX, | ||
y: e.changedTouches[i].clientY, | ||
source: this.getSourceNode(e,element) | ||
var changed = e.changedTouches, | ||
i = 0, | ||
l = changed.length; | ||
for (; i < l; i++) { | ||
element._handleTouchEvent(this.name, { | ||
x: changed[i].clientX, | ||
y: changed[i].clientY, | ||
source: this.getSourceNode(e, element) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cache source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
}); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should cache the source node so that it isn't recalculated each iteration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Fixed!