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

[Vue] fix infinite loop when using custom field angularjs template #18507

Merged
merged 1 commit into from Dec 15, 2021

Conversation

diosmosis
Copy link
Member

Description:

In the FieldAngularJsTemplate.vue component we clone the form field value before it goes to angularjs and vice versa in order to make sure mutations in angularjs, where the data is meant to be mutable, doesn't create unexpected changes in the Vue layer, where the data is not meant to be modified by the form field components. Currently this causes an infinite loop in some cases as we check instance equality, and the instance changes when we clone the value. Fixed by doing a deep equal before propagating changes from either side.

Review

@diosmosis diosmosis added the Needs Review PRs that need a code review label Dec 15, 2021
@diosmosis diosmosis added this to the 4.7.0 milestone Dec 15, 2021
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works 👍

@diosmosis diosmosis merged commit b85c6f0 into 4.x-dev Dec 15, 2021
@diosmosis diosmosis deleted the vue-fix-field-angularjs-infinite-loop branch December 15, 2021 18:53
@justinvelluppillai justinvelluppillai added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants