@@ -188,7 +188,7 @@ class RecordActionTool implements RecorderTool {
188
188
return ;
189
189
if ( this . _actionInProgress ( event ) )
190
190
return ;
191
- if ( this . _consumedDueWrongTarget ( event , this . _hoveredModel ) )
191
+ if ( this . _consumedDueToNoModel ( event , this . _hoveredModel ) )
192
192
return ;
193
193
194
194
const checkbox = asCheckbox ( this . _recorder . deepEventTarget ( event ) ) ;
@@ -283,7 +283,7 @@ class RecordActionTool implements RecorderTool {
283
283
}
284
284
285
285
// Non-navigating actions are simply recorded by Playwright.
286
- if ( this . _consumedDueWrongTarget ( event , this . _activeModel ) )
286
+ if ( this . _consumedDueWrongTarget ( event ) )
287
287
return ;
288
288
this . _recorder . delegate . recordAction ?.( {
289
289
name : 'fill' ,
@@ -313,7 +313,7 @@ class RecordActionTool implements RecorderTool {
313
313
this . _expectProgrammaticKeyUp = true ;
314
314
return ;
315
315
}
316
- if ( this . _consumedDueWrongTarget ( event , this . _activeModel ) )
316
+ if ( this . _consumedDueWrongTarget ( event ) )
317
317
return ;
318
318
// Similarly to click, trigger checkbox on key event, not input.
319
319
if ( event . key === ' ' ) {
@@ -373,7 +373,7 @@ class RecordActionTool implements RecorderTool {
373
373
const nodeName = target . nodeName ;
374
374
if ( nodeName === 'SELECT' || nodeName === 'OPTION' )
375
375
return true ;
376
- if ( nodeName === 'INPUT' && [ 'date' , 'range' ] . includes ( ( target as HTMLInputElement ) . type ) )
376
+ if ( nodeName === 'INPUT' && [ 'date' ] . includes ( ( target as HTMLInputElement ) . type ) )
377
377
return true ;
378
378
return false ;
379
379
}
@@ -387,8 +387,15 @@ class RecordActionTool implements RecorderTool {
387
387
return false ;
388
388
}
389
389
390
- private _consumedDueWrongTarget ( event : Event , model : HighlightModel | null ) : boolean {
391
- if ( model && model . elements [ 0 ] === this . _recorder . deepEventTarget ( event ) )
390
+ private _consumedDueToNoModel ( event : Event , model : HighlightModel | null ) : boolean {
391
+ if ( model )
392
+ return false ;
393
+ consumeEvent ( event ) ;
394
+ return true ;
395
+ }
396
+
397
+ private _consumedDueWrongTarget ( event : Event ) : boolean {
398
+ if ( this . _activeModel && this . _activeModel . elements [ 0 ] === this . _recorder . deepEventTarget ( event ) )
392
399
return false ;
393
400
consumeEvent ( event ) ;
394
401
return true ;
0 commit comments