Using mousedown event can lead to some edge cases.
In our app, changing step changes the modal content, thus its height, and a mouseup event would then be fired outside the modal: so changing step was actually closing the modal... it was hard to find why!
Also, this would be better for accessibility because I think using enter actually trigger the click event natively.
I can't think of any reason why using mousedown would be better, but I might be wrong!
Using
mousedown
event can lead to some edge cases.In our app, changing step changes the modal content, thus its height, and a mouseup event would then be fired outside the modal: so changing step was actually closing the modal... it was hard to find why!
Also, this would be better for accessibility because I think using
enter
actually trigger theclick
event natively.I can't think of any reason why using
mousedown
would be better, but I might be wrong!Related: https://github.com/unovue/radix-vue/discussions/1330