Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add Form Input Example #1164

Unanswered
MentalGear asked this question in Q&A
Discussion options

Thx for this testing library - the docs are well written, accessibility is a priority and queries well explained.

However, when it comes to the manipulation of form elements, I couldn't find an example or section of it in the docs.

Doing this, for example, works, but gives a typescript error in VSCode

        const firstName = screen.getByRole('textbox', { name: /first name/i })
        firstName.value = 'John Simpleton'

Property 'value' does not exist on type 'HTMLElement'

You must be logged in to vote

Replies: 1 comment

Comment options

To interact with elements either use fireEvent or user-event

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.