Ajax Search Pro not working inside an Elementor Popup

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Ajax Search Pro not working inside an Elementor Popup

This topic contains 7 replies, has 2 voices, and was last updated by Arnau Arnau 4 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #23668
    Arnau
    Arnau
    Participant

    Hi there,

    Ajax Search Pro is working fine with Elementor, except if the search form is inside a popup created with Elementor Pro. In this case, there are not automatic results shown.

    In the URL there are 2 Ajax forms: One in the middle of the page, wich is working fine, and another inside an Elementor Popup that can be opened clicking in the magnifying glass icon in the header. This is not working.

    The search form is the same in both cases.

    Is there a way to solve ti?

    Thanks,

    Arnau

    #23671
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Arnau,

    Thank you for all the details! Since you added temporary FTP and back-end details, I have fixed the issue by adding a small custom code snippet to the functions.php file in your theme directory.

    The problem is, that elementor always clones the pop-up contents, which basically resets the event handlers, thus it won’t work. The code checks when the icon is clicked, and tries to re-initialize the plugin, and should bypass the problem.

    For future reference, this is the custom code:

    add_action('wp_footer', 'asp_fix_fa_icon_click');
    function asp_fix_fa_icon_click() {
      ?>
      <script>
      jQuery(function($){
        $('.fa.fa-search').on('click', function(){
          setTimeout(function(){
            ASP.initialize();
          }, 500);
        });
      });
      </script>
      <?php
    } 
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23683
    Arnau
    Arnau
    Participant

    Hi Ernest,

    Thanks a lot for this great and fast solution!

    #23684
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23690
    Arnau
    Arnau
    Participant
    You cannot access this content.
    #23691
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you!

    I am not sure if I can replicate that issue. I tried closing the pop-up with the X button, as well as by clicking on the document, but the results close as well. Is this happening in a specific way?

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23699
    Arnau
    Arnau
    Participant

    Hi Ernest.
    I can’t replicate the issue also. It seems to work fine.

    Thanks a lot, again!

    #23700
    Arnau
    Arnau
    Participant
    You cannot access this content.
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.