Skip to content

Emulation of 'Backspace' and other non alphanumeric buttons pressing. #172

@kernel72

Description

@kernel72

Hi, guys!

I have a next question, which has come during usage of this cool library.
I have to simulate a user's "Backspace" button pressing and could not find how to do it with this library.
Unfortunately, the native testing-library fireEvent is not works for me, because I have an input which filters pressed keys in onKeyDown event handler and it also has onChange event handler which makes additional validation and further component mutations.
I use user-event to check that both events have been fires correclty and check the final value of input.

'Backspace' is also have to pass through this filter to erase typed data, but I couldn't find how to call it.

Could you please advice something?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions