Okay
  Public Ticket #997990
Greedy Select2 bindings.
Closed

Comments

  •  1
    croadgraphics started the conversation

    We have built in some custom functionality to the WooCommerce checkout/cart via 3rd party plugins and some custom code, one issue is that there is a modal that pops up on checkout asking for further input.  In that modal is a hidden select (populated by the modal js if options are provided).  Unfortunately due to how you greedily bind select2 to all dropdowns on the any page with woocommerce-ordering class this overrides the default dropdown functionality.

    The code in question is on line 12554 of init.js in the theme.

    Due to the fact you are basically binding select2 to ANY select on that page it makes customizing the checkout/cart pages difficult.  The modal we are using in question is SweetAlert2.  

    I do not have a good solution to the problem, I could request that you add a check for the sweetalert modal but that seems like a bandaid solution.  I don't know the reasoning behind doing the greedy bindings, but I hope this will be fixed in the next update.


  •  1
    croadgraphics replied

    For a temporary fix I have deregistered the parent script, copied it into the child theme to register there and modified it to watch for SweetAlert2 modals.  I hope this is does not have to be a permanent solution to this issue..

  •  8,996
    Tahir replied

    Hey Again,

    You can always turn off the Select2 Bindings in the Salient Theme Options Panel -> Form Styling Section : 

    Best.


    ThemeNectar Support Team