Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search hidden on click in Safari mobile browser
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 3 years, 1 month ago.
- AuthorPosts
- April 7, 2020 at 9:23 am #26630
Hello Ajax Search Pro,
We are having some issues with the search field when browsing our site, onlineobchodovanie.sk on mobile devices with Safari browser.
When you click on the Search the menu will disappear. You still have option to type your search query, however the search field is hidden from the screen.
I have attached screenshot here.
I have also updated to the latest plugin version, 4.18.3 and read that similar issue was fixed in the release 2017.08.02 – 4.11.1 – Minor, bugfix release. But we are still having an issue with it.
Can you please advise?
Thank you
Regards
Peter
Attachments:
You must be logged in to view attached files.April 7, 2020 at 9:57 am #26636Hi Peter,
Thank you for the details, it helps a lot.
Well, it is not exactly a plugin issue, it is rather how the menu handles the events on clicking on each individual link. The search is printed in a link element, and by default that closes the menu – you can try that by clicking on any menu item, right before redirection, it closes.
This should be rather solved via the menu scripts, but there might be a way to use a custom code to prevent the event propagation, so it does not close.Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_action('wp_footer', 'asp_wp_footer_nav_disable_event_propagation'); function asp_wp_footer_nav_disable_event_propagation() { ?> <script> jQuery(function($){ $('.asp_w input').on('touchend', (function(e){ e.preventDefault(); $(this).focus(); })); }); </script> <?php }
Please be careful, and not that I cannot guarantee this is going to work in every case, or at all.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 8, 2020 at 1:12 pm #26657Perfect. Thank you for the code. It works now as expected.
Kind regards
Peter
April 8, 2020 at 3:01 pm #26658You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.