hummingbird-project / hummingbird-examples

Examples demonstrating various aspects of the Hummingbird swift server framework
Apache License 2.0
90 stars 19 forks source link

update the todo state in the "todos-auth-fluent" example #37

Closed DesdeChaves closed 1 year ago

DesdeChaves commented 1 year ago

I found a small issue in the "todos-auth-fluent" example, where after changing the todo state, the displayed checkbox remains set to the one defined for the incomplete state. I believe that more reactivity is required. I am unsure whether the best option is to make a new call to the Home route or to use JavaScript to update the visual state of the todo.

Thanks for all support.

Jorge

adam-fowler commented 1 year ago

Which browser are you seeing this on? It was working for me on Safari

DesdeChaves commented 1 year ago

I'm in linux. The problem in only in Firefox Browser 115.01 (needs page refresh). Works fine in Google Chrome 114.0.5735.198. Sorry for the noise.

Thank you very much for your support and attention.

adam-fowler commented 1 year ago

Fixed Firefox is trying to be clever by remembering checkbox state on reloads, which means it overrides the state set in the html. The fix is to ensure the checkbox checked state is set before reloading