Skip to content

Commit 48340f8

Browse files
committed
Prevented the elementId for a form tracking event from being empty
1 parent 09a58d8 commit 48340f8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/js/forms.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ object.getFormTrackingManager = function (core, trackerId) {
5454
function getFormElementName(elt) {
5555
return elt[lodash.find(['name', 'id', 'type', 'nodeName'], function (propName) {
5656

57-
// If elt has a child whose name is "id", that element will be returned
58-
// instead of the actual id of elt unless we ensure that a string is returned
59-
return typeof elt[propName] === 'string';
57+
// If elt has a child whose name is "id", that element will be returned
58+
// instead of the actual id of elt unless we ensure that a string is returned
59+
return elt[propName] && typeof elt[propName] === 'string';
6060
})];
6161
}
6262

0 commit comments

Comments
 (0)