Open fpaboim opened 9 years ago
Can't reproduce this. Can you provide more details?
In my case I have to check if certain fields have the same number of elements. To do this I use:
field_A:
type: [String]
custom: ->
if (@field('field_B').value.length != @value.length)
return 'sameNumberMessage'
'field_A.$':
autoform:
afFieldInput:
type: 'fileUpload'
collection: 'images'
accept: 'image/*'
Starting with two elements in each array if I remove an element with the '-' instead of the 'x Remove' button, I get one less element. If after removing I add another element, the last element seems to reappear and the array now shows two elements but fails the verification stating it does not have the same number of elements. Checking the number of elements of the modified array adding a 'console.log @value.length' to the custom callback show that while apparently there are two images, in reality the callback 'sees' 3, seemingly readding the previously deleted image.
Has anyone solve this?, I got exactly this in 0.4.2 Any help please.
Images are correctly removed with the 'x Remove' button, but if i click on the '-' button and after query for the values, then re-add the image to the array, the array length outputs as 3 when it should be 2.