maxmarcon / live_select

Dynamic (multi)selection field for LiveView
https://hex.pm/packages/live_select
Apache License 2.0
186 stars 35 forks source link

Editing another field sets live select field to value instead of label #66

Closed hunterboerner closed 6 months ago

hunterboerner commented 6 months ago

If I have a form with two fields, a and b where b is a live_select set to "Foo", value "bar". Then when I edit a, b changes to bar. Changing a should not change b.

hunterboerner commented 6 months ago

Ok so I figured out this is the result of the integer ids being converted into strings at some point and then it doesn't map correctly. Changing my value in my options map to string and providing & to_string(&1) as a value_mapper solves this issue.