Skip to content

Commit 0e523f4

Browse files
committed
Ignore synthetic click event
Skip the click if it was done programmatically and just handle the cached submit, otherwise it would lead to doing the same action twice on replaying with the click failing. Signed-off-by: thc202 <[email protected]>
1 parent f421dbe commit 0e523f4

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77

88
### Fixed
99
- Ignore events on non-visible elements, which will fail on replay.
10+
- Ignore click after submit, since the former is a side effect of the latter.
1011

1112
## 0.1.7 - 2025-11-28
1213

CHANGELOG.rec.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77

88
### Fixed
99
- Ignore events on non-visible elements, which will fail on replay.
10+
- Ignore click after submit, since the former is a side effect of the latter.
1011

1112
## 0.1.7 - 2025-11-28
1213

source/ContentScript/recorder.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ class Recorder {
145145
this.handleFrameSwitches(level, frame);
146146
console.log(event, 'ZAP clicked');
147147
const elementLocator = getPath(event.target as HTMLElement, element);
148+
149+
if ((event as MouseEvent).detail === 0) {
150+
// Not a user click.
151+
if (this.cachedSubmit) {
152+
this.handleCachedSubmit();
153+
}
154+
return;
155+
}
156+
148157
this.sendZestScriptToZAP(
149158
new ZestStatementElementScrollTo(elementLocator, waited),
150159
false

0 commit comments

Comments
 (0)