mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
Fix TypeError in codegen (#35921)
This commit is contained in:
parent
d476f1d3b4
commit
cd32b0a231
@ -545,6 +545,10 @@ class RecordActionTool implements RecorderTool {
|
||||
}
|
||||
|
||||
private _shouldGenerateKeyPressFor(event: KeyboardEvent): boolean {
|
||||
// IME can generate keyboard events that don't provide a value for the key property (e.g. chrome autofill)
|
||||
if (typeof event.key !== 'string')
|
||||
return false;
|
||||
|
||||
// Enter aka. new line is handled in input event.
|
||||
if (event.key === 'Enter' && (this._recorder.deepEventTarget(event).nodeName === 'TEXTAREA' || this._recorder.deepEventTarget(event).isContentEditable))
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user