Closed as not planned
Closed as not planned
Description
Describe the Feature
User Event should throw errors in case of given element is disabled in any way that prevents the interaction to run in order to improve DX.
OG User Event does throw errors in similar cases for clear()
, and click()
/pointer()
interactions.
Note: This would be a breaking change, but according to User Event beta status would only trigger a minor change in the version.
Note 2: In the past we fireEvent was already throwing errors in the past when no enable event handler was found but that has been removed. Here are refs to the issue: #469, and PR #470
Possible Implementations
type()
&clear()
should throw helpful error when element is noteditable
or not focusable due topointerEvent
prop on itself or any ancestorpress()
should throw helpful error when element is not pressable due topointerEvents
prop on itself on ancestor.
These should not throw in case no event handler is found, as user interaction can invoke multiple events handler, hence any particular event handler is optional.