File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
212219export { initPhoneFormatting , formatPhoneNumber } ;
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments