Skip to content

Commit 2ea8362

Browse files
committed
fix
1 parent 76c0d89 commit 2ea8362

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

website/modules/asset/ui/src/js/phoneFormat.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,15 @@ const initPhoneFormatting = function () {
205205
});
206206
};
207207

208+
let initialized = false;
209+
208210
// Initialize after DOM is loaded
209-
document.addEventListener('DOMContentLoaded', initPhoneFormatting);
211+
document.addEventListener('DOMContentLoaded', () => {
212+
if (!initialized) {
213+
initPhoneFormatting();
214+
initialized = true;
215+
}
216+
});
210217

211218
// Export the function for use in other modules
212219
export { initPhoneFormatting, formatPhoneNumber };

website/modules/form-preset-names/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
i += 1
2121
) {
2222
const field = items[i];
23-
if (field.fieldName && !standardNames.includes(field.fieldName)) {
23+
if (field?.fieldName && !standardNames.includes(field.fieldName)) {
2424
field.fieldName = standardNames[i];
2525
}
2626
}

0 commit comments

Comments
 (0)