From 10ae41bf5dab54cdfacfc856454b9355e40d3df3 Mon Sep 17 00:00:00 2001 From: Rens Date: Fri, 4 Mar 2022 04:56:30 +0100 Subject: [PATCH] fix issue with dynamic columns --- docs/changelog.md | 4 ++++ src/assets/js/frontend/elements.js | 7 +++---- src/docs/changelog.md | 4 ++++ src/super-forms.php | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 3709c73e..94ea926d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -8,6 +8,10 @@ - [PDF Generator Add-on](https://renstillmann.github.io/super-forms/#/pdf-generator-add-on) +## Mar 04, 2022 - Version 6.2.201 + +- **Fix:** An issue since v6.2.200 with dynamic columns where newly columns were inserted after the first column + ## Feb 24, 2022 - Version 6.2.200 - **Improved:** `Register & Login` Option to define custom headers for emails such as `Verification`, `Approval` and `Reset Password` E-mails diff --git a/src/assets/js/frontend/elements.js b/src/assets/js/frontend/elements.js index f1db9fd5..64090202 100644 --- a/src/assets/js/frontend/elements.js +++ b/src/assets/js/frontend/elements.js @@ -1991,7 +1991,6 @@ } }); - // @since 1.7 - improved dynamic columns $doc.on('click', '.super-form .super-duplicate-column-fields .super-add-duplicate', function(){ var i, x, y, @@ -2003,6 +2002,7 @@ column, form, firstColumn, + lastColumn, found, limit, unique_field_names = {}, @@ -2090,14 +2090,13 @@ counter = column.querySelectorAll(':scope > .super-duplicate-column-fields').length; clone = firstColumn.cloneNode(true); - firstColumn.parentNode.insertBefore(clone, firstColumn.nextElementSibling); + lastColumn = duplicateColumns[(found-1)]; + lastColumn.parentNode.insertBefore(clone, lastColumn.nextElementSibling); // @since 3.3.0 - hook after appending new column - SUPER.after_appending_duplicated_column_hook(form, unique_field_names, clone); // Now reset field values to default - SUPER.init_clear_form({form: form, clone: clone}); // @since 3.2.0 - increment for tab index fields when dynamic column is cloned diff --git a/src/docs/changelog.md b/src/docs/changelog.md index 3709c73e..94ea926d 100644 --- a/src/docs/changelog.md +++ b/src/docs/changelog.md @@ -8,6 +8,10 @@ - [PDF Generator Add-on](https://renstillmann.github.io/super-forms/#/pdf-generator-add-on) +## Mar 04, 2022 - Version 6.2.201 + +- **Fix:** An issue since v6.2.200 with dynamic columns where newly columns were inserted after the first column + ## Feb 24, 2022 - Version 6.2.200 - **Improved:** `Register & Login` Option to define custom headers for emails such as `Verification`, `Approval` and `Reset Password` E-mails diff --git a/src/super-forms.php b/src/super-forms.php index 4b4807dd..c0f99d9d 100644 --- a/src/super-forms.php +++ b/src/super-forms.php @@ -11,7 +11,7 @@ * @wordpress-plugin * Plugin Name: Super Forms - Drag & Drop Form Builder * Description: The most advanced, flexible and easy to use form builder for WordPress! - * Version: 6.2.200 + * Version: 6.2.201 * Plugin URI: http://f4d.nl/super-forms * Author URI: http://f4d.nl/super-forms * Author: feeling4design @@ -43,7 +43,7 @@ final class SUPER_Forms { * * @since 1.0.0 */ - public $version = '6.2.200'; + public $version = '6.2.201'; public $slug = 'super-forms'; public $apiUrl = 'https://api.super-forms.com/'; public $apiVersion = 'v1';