ory / elements

Ory Elements is a component library that makes building login, registration and account pages for Ory a breeze. Check out the components library on Chromatic https://www.chromatic.com/library?appId=63b58e306cfd32348fa48d50
https://ory.sh
Apache License 2.0
84 stars 41 forks source link

fix: disable button on submit #171

Closed hperl closed 6 months ago

hperl commented 6 months ago

Related Issue or Design Document

Checklist

Further comments

jonas-jonas commented 6 months ago

This doesn't actually work. The reason is, that the click event fires before the submit event of the enclosing form, and disabling the button in the event stops event propagation. There are a few solutions, but IMO we should just get this right in AX2 before spending any more time on this. The underlying issue is fixed either way, and this was purely cosmetic.

alnr commented 6 months ago

Wouldn't the fix just be to change click to submit?

jonas-jonas commented 6 months ago

Wouldn't the fix just be to change click to submit?

Submit fires on the form, not the button itself.

alnr commented 6 months ago

https://chat.openai.com/share/b85618ff-b1c3-4c28-b36f-44d35556216c

jonas-jonas commented 6 months ago

yea, as I linked there are solutions, just don't want to spend time on getting this right, right now. PRs welcome ;)