Closed duhrer closed 4 months ago
With the changes here, a button click behaves much more like a mouse click, and no test changes were needed.
I think we need to add a better test suite for clicks, I tried this with something like Weavly, the mouse events didn't make it through.
The previous approach (triggering the click function instead of dispatching a click event) does work, I may revert just that call.
We have long converted to using the click
function for everything, and given that we don't really do anything on button release, there doesn't seem to be much point in simulating all three events unless we have a good example of an element that requires it.
Currently, the "click" action triggers the "click" function directly on the focused (non-select) target element. This has a couple of key limitations:
event.preventDefault
will fail.It would be better to dispatch a "mousedown" and "click" even when the button is pressed, and to dispatch a "mouseup" even when the button is released.