Skip to content

Commit 45ca399

Browse files
committed
Fix compatibility of form number input with prior kino versions
1 parent efa4abb commit 45ca399

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/livebook/session.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3329,6 +3329,16 @@ defmodule Livebook.Session do
33293329
end)
33303330
end
33313331

3332+
defp normalize_runtime_output(%{type: :control} = control) when control.attrs.type == :form do
3333+
update_in(control.attrs.fields, fn fields ->
3334+
Enum.map(fields, fn
3335+
{field, nil} -> {field, nil}
3336+
# Normalize each form input.
3337+
{field, input} -> {field, normalize_runtime_output(input)}
3338+
end)
3339+
end)
3340+
end
3341+
33323342
# Traverse composite outputs
33333343

33343344
defp normalize_runtime_output(%{type: :grid} = grid) do

0 commit comments

Comments
 (0)