Make `addItem` button work for array fields.

It logged an error to console before.
Merge pull request #818 from metasansana/fix-add-item-button

Make `addItem` button work for array fields.