Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/js/live_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
},
reconnected() {
if (this.selection && this.selection.length > 0) {
this.pushEventTo(this.el.id, "selection_recovery", this.selection)
this.pushEventTo(this.el, "selection_recovery", this.selection)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/live_select/component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ defmodule LiveSelect.Component do
def handle_event("selection_recovery", selection_from_client, socket) do
# selection recovery. If we are here, it means that the view has crashed
# The values have been sent to the form by LV selection recovery and are now in the selection assigns
# However, the label have been lost because selection recovery only sends the values.
# However, the labels have been lost because selection recovery only sends the values.
# Therefore, the component sends this event with the selection stored on the client, which contains the labels
# Using this selection, we can restore the options and augment the current selection with the labels

Expand Down
2 changes: 1 addition & 1 deletion lib/live_select/component.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<%= for {option, idx} <- Enum.with_index(@options) do %>
<li class={
cond do
option.disabled ->
Map.has_key?(option, :disabled) && option.disabled ->
class(@style, :unavailable_option, @unavailable_option_class)

already_selected?(option, @selection) ->
Expand Down
Loading