diff --git a/src/client/automation/playback/drag/base.js b/src/client/automation/playback/drag/base.js index 862191e6451..34e5c2e187d 100644 --- a/src/client/automation/playback/drag/base.js +++ b/src/client/automation/playback/drag/base.js @@ -92,7 +92,7 @@ export default class DragAutomationBase extends VisibleElementAutomation { }); } - _mouseup () { + _mouseup (draggedElement) { return cursor .buttonUp() .then(() => { @@ -126,7 +126,7 @@ export default class DragAutomationBase extends VisibleElementAutomation { }) .then(element => { //B231323 - if (topElement && element === topElement && !this.dragAndDropState.enabled) + if (topElement && element === topElement && !this.dragAndDropState.enabled && element === draggedElement) eventSimulator.click(topElement, options); }); }); @@ -152,6 +152,6 @@ export default class DragAutomationBase extends VisibleElementAutomation { return Promise.all([delay(this.automationSettings.mouseActionStepDelay), this._mousedown(eventArgs)]); }) .then(() => this._drag()) - .then(() => this._mouseup()); + .then(() => this._mouseup(eventArgs.element)); } } diff --git a/test/functional/fixtures/regression/gh-8250/pages/index.html b/test/functional/fixtures/regression/gh-8250/pages/index.html new file mode 100644 index 00000000000..174a0ff9340 --- /dev/null +++ b/test/functional/fixtures/regression/gh-8250/pages/index.html @@ -0,0 +1,11 @@ + + +
+ +