Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursively undo cloned trees #3690

Merged
merged 2 commits into from
Feb 25, 2025
Merged

recursively undo cloned trees #3690

merged 2 commits into from
Feb 25, 2025

Conversation

SteffenDE
Copy link
Collaborator

Fixes: #3684.
Relates to: #3652

The issue was that when we locked a form with an input inside where the input changed, the form was cloned and then later the input inside was cloned as well, stored inside the already cloned parent. When undoing, previously the simple patch copied over the PHX_PRIVATE of the cloned elements, but with the full DOMPatch, the privates of the source element were copied, discarding the clone of the input. With this change, we check if we are undoing locks and manually copy over nested clones to ensure that they can be correctly applied afterwards.

Fixes: #3684.
Relates to: #3652

The issue was that when we locked a form with an input inside where the
input changed, the form was cloned and then later the input inside was
cloned as well, stored inside the already cloned parent. When undoing,
previously the simple patch copied over the PHX_PRIVATE of the cloned
elements, but with the full DOMPatch, the privates of the source element
were copied, discarding the clone of the input. With this change, we check
if we are undoing locks and manually copy over nested clones to ensure
that they can be correctly applied afterwards.
@SteffenDE SteffenDE force-pushed the sd-recursive-undo-clones branch from 76ece61 to 6fd7ecd Compare February 25, 2025 16:59
@SteffenDE SteffenDE merged commit 4126478 into main Feb 25, 2025
16 checks passed
@SteffenDE SteffenDE deleted the sd-recursive-undo-clones branch February 25, 2025 17:33
SteffenDE added a commit that referenced this pull request Feb 25, 2025
* recursively undo cloned trees

Fixes: #3684.
Relates to: #3652

The issue was that when we locked a form with an input inside where the
input changed, the form was cloned and then later the input inside was
cloned as well, stored inside the already cloned parent. When undoing,
previously the simple patch copied over the PHX_PRIVATE of the cloned
elements, but with the full DOMPatch, the privates of the source element
were copied, discarding the clone of the input. With this change, we check
if we are undoing locks and manually copy over nested clones to ensure
that they can be correctly applied afterwards.

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Radio input checked state regression between v1.0.2..v1.0.3
1 participant