Fixed unique ID generation for some cases #668
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are now using unique id counter instead of relying on List.Count,
which solves problems with controls added in a strange order (like
x.Add(controlA); x.Add(controlB); x.Remove(controlA); x.Add(controlC)
,where B and C remain in
x
with the same id).When a control is added to the collection, it's id is assigned only if
it's parent also has the id. And when the id is assigned, it's assigned
recursively to the entire subtree that does not have any ids. This solves
problems with entire hiearchies being added into the control tree (that
are heavily used in DotVVM BP)
@quigamdev Could you please check that it really solves these problems in BusinessPack and that it does not create new ones?