LiveSelect and LiveView versions
LiveSelect: 1.4.2
LiveView: 0.20.17
Describe the bug
If the value is pre-selected or sent via send_update then it does not reappear in the input after focus & blur.
Expected behavior
The selected value should be there after focus & blur, even if it was set from the outside of the component.
Actual behavior
The previous manually selected value is restored (or it stays empty, if no manual selection was performed).
Browsers
Chrome, Safari
Additional context
After looking through the code, I think I know what the fix could be - the update callback could use a socket = maybe_save_selection(socket) after applying the value from value or field assigns.
LiveSelect and LiveView versions LiveSelect: 1.4.2 LiveView: 0.20.17
Describe the bug If the value is pre-selected or sent via
send_update
then it does not reappear in the input after focus & blur.Expected behavior The selected value should be there after focus & blur, even if it was set from the outside of the component.
Actual behavior The previous manually selected value is restored (or it stays empty, if no manual selection was performed).
Browsers Chrome, Safari
Additional context After looking through the code, I think I know what the fix could be - the
update
callback could use asocket = maybe_save_selection(socket)
after applying the value fromvalue
orfield
assigns.I'll try to get a PR with the suggested fix.