Skip to content

CDK/testing: typeInElement ignores event.defaultPrevented #27475

Open
@garysoed

Description

@garysoed

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

The typeInElement 1 still sets the input value even if the keydown event has default prevented. This is different from the actual behavior 2

Reproduction

StackBlitz link: https://stackblitz.com/edit/harness-issue-4xv58x?file=src%2Fapp%2Fharness-example.html

Expected Behavior

event.preventDefault() should stop the browser from populating the input element.

Actual Behavior

Input element is still populated with values

Environment

  • Angular: 10.2.3
  • CDK/Material: 11.0.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    GThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions