• Resolved mafox2

    (@mafox2)


    Having a problem getting the conditional fields to work within a bootstrap modal on our site. In the top right of the page we have created a “Get a Quote” button to trigger the modal which includes a contact form. When selecting either Canada or United States of America (the) from the country field a conditional field should appear to select province or state respectfully..

    This is the error generated: (using Conditional Fields for CF7 v2.3.10 with CF7 v5.8)

    scripts.js:1838 Uncaught TypeError: Invalid attempt to spread non-iterable instance.
    In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
    at _nonIterableSpread (scripts.js:1838:9)
    at _toConsumableArray (scripts.js:1884:95)
    at Wpcf7cfForm.form.updateSimpleDom (scripts.js:354:104)
    at scripts.js:670:12

    Seems to be an error in the scripts.js file.

    Line 1834... /*! no static exports found */
    /***/ (function(module, exports) {
    
    function _nonIterableSpread() {
      throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    
    module.exports = _nonIterableSpread;
    
    /***/ }),

    We modified the scripts.js file as follows which allows the fields to display

    Line 1834... /***/ (function(module, exports) {
    
    function _nonIterableSpread() {
    
    	// workaround 2023/08/01
    	return [];
      // throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    
    module.exports = _nonIterableSpread;
    
    /***/ }),

    It does not seem to cause any errors on our other forms with conditionals which are not inside a bootstrap modal. Any thoughts on how to create a permanent fix in the plugin? Would prefer not to modify the core files…

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Conditional Fields not working inside Boostrap Modal 5.2’ is closed to new replies.