Skip to content

Commit af890a9

Browse files
authored
Merge pull request #3659 from nbolender/repeatable-handle-undefined-values
Handle undefined values for repeatable
2 parents 9338f97 + d2674fb commit af890a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/resources/views/crud/fields/repeatable.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function newRepeatableElement(container, field_group, values) {
216216
if (values != null) {
217217
// set the value on field inputs, based on the JSON in the hidden input
218218
new_field_group.find('input, select, textarea').each(function () {
219-
if ($(this).data('repeatable-input-name')) {
219+
if ($(this).data('repeatable-input-name') && values.hasOwnProperty($(this).data('repeatable-input-name'))) {
220220
221221
// if the field provides a `data-value-prefix` attribute, we should respect that and add that prefix to the value.
222222
// this is different than using prefix in fields like text, number etc. In those cases the prefix is used

0 commit comments

Comments
 (0)