Last active
December 17, 2023 01:21
-
-
Save ChobPT/6d0d38dae0d072c7bdbfdb8a0de1e4f2 to your computer and use it in GitHub Desktop.
Fix Elementor + Select2's conflict on popups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Chob 2023 | |
- Place this file on your theme and call it from functions.php OR, | |
- Simply copy the contents of this file and use Elementor > Code Blocks | |
to paste this code inside <script></script> tags. | |
Enjoy! | |
*/ | |
jQuery(document).ready(function(){ | |
jQuery( document ).on( 'elementor/popup/show', () => { | |
jQuery('.select2-hidden-accessible').each(function(){ | |
var newOptions = jQuery(this).data('select2').options.options; | |
newOptions["dropdownParent"]= jQuery(this).parent(); | |
jQuery(this).select2(newOptions); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment