Open ndbroadbent opened 6 years ago
It's because the removeItem
function refuses to do anything unless this._validateEqualMinItems()
is true. In my case, that was always returning false, so it got stuck in an infinite loop.
My quick workaround is to add a force
argument to ignore the validation:
removeItem: function(childIndex, callback, force)
{
var self = this;
if (this._validateEqualMinItems() || force)
{
And I changed the calling code to:
self.removeItem(i, null, true);
Please let me know if you would like a PR for this, or if there's a better way to solve the problem.
Infinite loop is happening here: https://github.com/gitana/alpaca/blob/7e221a1fd8d7907ffd5d32e000b4612ff40ade39/src/js/fields/basic/ArrayField.js#L311-L328
I'll debug some more and maybe send a PR.