Magetwo 70954: Remove the component.clear from the custom options type. This causes the 'elem' array to become out of sync with the recordData #11824
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.
Description
The issue here is that when switching custom options types in the product edit screen, there can be instances where there is a perpetual spinner that is shown. In my findings, this was because there were 2 variables and 1 function that were checked to be 'in-sync' with each other as far as the length of items in each javascript array.
"recordData", "elems", and function "getChildItems". These three pieces were in the "dynamic-rows.js" file. As far as I could tell, the spinner in is not something that would ever make sense to be used in this case. However, because it was listed as an observable of elems, and elems was used for other things, it seemed to make more sense to find the cause of why elems would be 0 when it needed to match the getChildItems function.
Tracing this back, "elems" was part of the UiSelect object, and it was doing a component.clear() whenever the value of the option type selector changed. There is also no history from this file before: 566be67#diff-2c1b11e20e699888b25df7c484e62d20
So it was difficult to say if this was added in or generated. I search the code base for instances of uses of the UiSelect as a component to clear values, and didn't find anything that seemed exceptional, so I think this removal would be localized to only thes adminhtml custom options.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist