Skip to content

Commit

Permalink
fix: add check prev element
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelMor25 committed Sep 27, 2024
1 parent 4c9f03b commit 70f1156
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/client/automation/playback/move/event-sequence/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ export default class MoveEventSequenceBase {
}

run (currentElement, prevElement, options, dragElement, dragDataStore) {

const prevElementInDocument = prevElement && domUtils.isElementInDocument(prevElement);

const prevElementInRemovedIframe = prevElement && domUtils.isElementInIframe(prevElement) &&
!domUtils.getIframeByElement(prevElement);

if (!prevElementInDocument || prevElementInRemovedIframe)
prevElement = null;

const elementChanged = currentElement !== prevElement;
const commonAncestor = elementChanged ? domUtils.getCommonAncestor(currentElement, prevElement) : null;

Expand Down

0 comments on commit 70f1156

Please sign in to comment.