React input type="number" onChange not triggering from userEvent.keyboard('{backspace}') #711
Labels
accuracy
Improves the accuracy of how behavior is simulated
Milestone
@testing-library/user-event
: 13.2.1@testing-library/dom
: 8.1.0@testing-library/jest-dom
: 5.14.1@testing-library/react
: 12.0.0What you did:
Performing a
userEvent.keyboard('{backspace}')
does not work correctly for a React Typescript inputtype = "number"
. Same behavior occurs for delete, ArrowUp, and ArrowDown.What happened:
onKeyDown
is triggered, butonChange
is never triggered.Reproduction repository:
https://codesandbox.io/s/user-event-input-typenumber-bug-3c9tr
Problem description:
Issue is only present on
type = "number"
input, if changing the same component totype = "text"
the backspace/delete keys properly triggeronChange
. (I understand the complexity of arrow keys being problematic on a text input, but seemingly the number input up/down arrow keys should perform the simple step increments).Have tried all variations of calling a
userEvent.click(input)
, oruserEvent.dblClick(input)
orinput.focus()
prior to attempting theuserEvent.keyboard('{backspace}')
and doing ainput.blur()
after attempting to delete input, all with same results ofonChange
not triggereing for atype = number
input.The text was updated successfully, but these errors were encountered: