It looks like phx_change is triggered for every key press in my live_view form. This is all nice and dandy for now; but what if my validation grows to something costly in the future? Is is possible to tune when it is triggered, for example, like when the user stop typing for a couple of seconds?
You can set the timing on each field with
phx-debounce="500"
Fire after 500ms
Or better
phx-debounce="blur"
Fire after user focus moves out of the form field. Usually change is complete, finished editing the form field.
2 Likes
Thanks, exactly what I am looking for.