8000 GitHub - dischoen/streams_resets_form: demonstration of streams reset side effects
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dischoen/streams_resets_form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streams_resets_form

I wanted to filter a .table in a Phoenix LiveView with multiple filters, i.e., one filter per column. For that I added a .simple_form above the .table and created a phx_change/handle_event pair. Filtering for one column went well at once, but when I wanted to filter for multiple columns and jumped to another field, the first field was cleared.

After some trying, I came to this solution:

  • Initially the form is filled with a map and to_form()
  • In the handle_event function I take the actual values from the second parameter and put them in a map and call to_form again, which is again assigned to the socket.

About

demonstration of streams reset side effects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0