Skip to content

Commit 90c111a

Browse files
committed
minor #13452 Fix count input on form collection (matthieumota)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #13452). Discussion ---------- Fix count input on form collection On documentation, ```:input``` is used to find all input on collection and guess how many items collection contains. But ```:input``` select the button to add item on collection. So it add an item by error. It cause error for instance with error mapping (Because it generate 1, 2, 3 instead of 0, 1, 2). We know it is our responsibility to check that as dev but it can help new developer to better apprehend Collection Type. Commits ------- 9c760d4 Fix count input on form collection
2 parents af42629 + 9c760d4 commit 90c111a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

form/form_collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ will be show next):
328328
329329
// count the current form inputs we have (e.g. 2), use that as the new
330330
// index when inserting a new item (e.g. 2)
331-
$collectionHolder.data('index', $collectionHolder.find(':input').length);
331+
$collectionHolder.data('index', $collectionHolder.find('input').length);
332332
333333
$addTagButton.on('click', function(e) {
334334
// add a new tag form (see next code block)

0 commit comments

Comments
 (0)