phoenixframework / phoenix_live_view

Rich, real-time user experiences with server-rendered HTML
https://hex.pm/packages/phoenix_live_view
MIT License
6k stars 906 forks source link

Show field errors on submit when field hasn't been "used" #3268

Closed nwjlyons closed 1 month ago

nwjlyons commented 1 month ago

re: LiveView 1.0.0-rc0

If a user submits the form without changing the input, no errors are shown.

This change will show field errors if the input is used or the form action is :submit.

Something to think about, developers could be using different words to represent the submit action. eg. :save

SteffenDE commented 1 month ago

Can you send an example where this doesn't work? A field is not marked as unused when the form is submitted.

https://github.com/phoenixframework/phoenix_live_view/blob/4c1e4c9807b43a1f00c790a4b613ca681e9dcc2c/assets/js/phoenix_live_view/view.js#L106

nwjlyons commented 1 month ago

Closing as I think it was an issue with my local setup.