Yapapaya / jquery-cloneya

A jquery plugin to clone DOM elements
MIT License
76 stars 28 forks source link

serializeIndex max clones #64

Closed bachilli closed 7 years ago

bachilli commented 7 years ago

When cloning more than 10 elements the serializeIndex keeps the index at 10.

acoulton commented 7 years ago

I was surprised by this as we've been using cloneya a while without noticing this, but it's verified at https://jsfiddle.net/to4nLr6z/1/

The fix in #66 seems to work, but the original implementation it removes looks surprisingly complex so I wonder if it was originally written like that to meet some other requirement/edge case I've not spotted?

bachilli commented 7 years ago

I think the only requirement/edge case that this fix can't meet is when you have a field with generic array without pré-setted index: ex. input type="text" name="thisisanarray[]" or nested arrays with numeric indexes name="this[nested][0][array][0]"

bachilli commented 7 years ago

Solved in merge. Need to recompile the .minified js