Make `addItem` button work for array fields.

It logged an error to console before.