unovue / radix-vue

Vue port of Radix UI Primitives. An open-source UI component library for building high-quality, accessible design systems and web apps.
https://radix-vue.com
MIT License
3.71k stars 231 forks source link

Stepper: replace onMousedown by onClick for consistency #1448

Open nicooprat opened 3 days ago

nicooprat commented 3 days ago

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!

Related: https://github.com/unovue/radix-vue/discussions/1330