mirror of
https://github.com/appium/appium.git
synced 2026-02-14 05:50:00 -06:00
Merge pull request #3733 from imurchie/isaac-android-release
Use last coordinates for touch release
This commit is contained in:
@@ -913,6 +913,21 @@ androidController.performTouch = function (gestures, cb) {
|
||||
// the `longPress` and `tap` methods release on their own
|
||||
gestures.pop();
|
||||
}
|
||||
|
||||
if (actions[actions.length - 1] === 'release') {
|
||||
// without coordinates, `release` uses the center of the screen, which,
|
||||
// generally speaking, is not what we want
|
||||
// therefore: loop backwards and use the last command with an element and/or
|
||||
// offset coordinates
|
||||
for (var i = actions.length - 2; i >= 0; i--) {
|
||||
var opts = gestures[i].options || {};
|
||||
if (opts.element || (opts.x && opts.y)) {
|
||||
gestures[gestures.length - 1].options = _.clone(opts);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var cycleThroughGestures = function (err, res) {
|
||||
if (err) return cb(err);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user