mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-13 08:24:22 +08:00
Don't report form control change on first render (#2852)
This commit is contained in:
parent
a8c08715e2
commit
dd29be252b
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ defmodule LivebookWeb.Output.ControlFormComponent do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def mount(socket) do
|
def mount(socket) do
|
||||||
{:ok, assign(socket, data: %{})}
|
{:ok, assign(socket, data: nil)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
@ -17,7 +17,7 @@ defmodule LivebookWeb.Output.ControlFormComponent do
|
||||||
{field, assigns.input_views[input.id].value}
|
{field, assigns.input_views[input.id].value}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if data != prev_data do
|
if prev_data != nil and data != prev_data do
|
||||||
change_data =
|
change_data =
|
||||||
for {field, value} <- data,
|
for {field, value} <- data,
|
||||||
assigns.control.attrs.report_changes[field],
|
assigns.control.attrs.report_changes[field],
|
||||||
|
|
Loading…
Add table
Reference in a new issue