Skip to content

Commit 866bc23

Browse files
committed
Merge branch 'only-register-input-events-in-text-and-textarea-fields' into crud-form-javascript-library
2 parents e865805 + e0e72fc commit 866bc23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/resources/views/crud/inc/form_fields_script.blade.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ class CrudField {
6666
return this;
6767
}
6868
69-
this.input?.addEventListener('input', fieldChanged, false);
69+
if(['text', 'textarea'].includes(this.input.getAttribute('type'))) {
70+
this.input?.addEventListener('input', fieldChanged, false);
71+
}
7072
this.$input.change(fieldChanged);
7173
7274
return this;
@@ -157,4 +159,4 @@ class CrudField {
157159
// Create all fields from a given name list
158160
fields: names => names.map(window.crud.field),
159161
};
160-
</script>
162+
</script>

0 commit comments

Comments
 (0)