From 6e02bd8d84a9dd130a4c45fb5f9f3340785e9a04 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Fri, 8 Jul 2022 18:19:21 +0530 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix(select2):=20added=20js?= =?UTF-8?q?=20to=20generate=20unique=20id=20for=20select2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/js/select2.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/library/js/select2.js b/library/js/select2.js index 675fa805..901b3974 100644 --- a/library/js/select2.js +++ b/library/js/select2.js @@ -10,11 +10,12 @@ FUI.select2 = function() { - $( '.forminator-custom-form' ).each( function() { + $( '.forminator-custom-form' ).each( function( index ) { var $element = $( this ), $formid = $element.data( 'form-id' ), - $select = $element.find( '.forminator-select2' ) + $select = $element.find( '.forminator-select2' ), + $formindex = index ; var $themes = [ @@ -40,6 +41,10 @@ var $select = $( this ), $parent = $select.closest( '.sui-dialog-content' ); + var id = $( this ).attr( 'id' ); + + $( this ).attr( 'id', id + '-' + $formindex ); + if ( true === $select.data( 'rtl-support' ) ) { $dir = 'rtl'; } else { @@ -72,7 +77,8 @@ placeholder: $placeholder, dropdownCssClass: 'forminator-custom-form-' + $formid + ' forminator-dropdown--' + $theme, minimumResultsForSearch: $hasSearch, - dropdownParent: $parent + dropdownParent: $parent, + width: '100%' }).on( 'select2:opening', function() { $select.data( 'select2' ).$dropdown.find( ':input.select2-search__field' ).prop( 'placeholder', $placeholder ); if ( $select.closest( '.hustle-popup' ).length || $select.closest( '.hustle-slidein' ) ) { From eb600a53f8ee4313b6bcb3c62b86dc4ba2bd1535 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Fri, 8 Jul 2022 18:20:43 +0530 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix(select2):=20added=20js?= =?UTF-8?q?=20to=20generate=20unique=20id=20for=20select2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/js/select2.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/js/select2.js b/library/js/select2.js index 901b3974..6c34510a 100644 --- a/library/js/select2.js +++ b/library/js/select2.js @@ -77,8 +77,7 @@ placeholder: $placeholder, dropdownCssClass: 'forminator-custom-form-' + $formid + ' forminator-dropdown--' + $theme, minimumResultsForSearch: $hasSearch, - dropdownParent: $parent, - width: '100%' + dropdownParent: $parent }).on( 'select2:opening', function() { $select.data( 'select2' ).$dropdown.find( ':input.select2-search__field' ).prop( 'placeholder', $placeholder ); if ( $select.closest( '.hustle-popup' ).length || $select.closest( '.hustle-slidein' ) ) {