Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search hidden on click in Safari mobile browser › Reply To: Search hidden on click in Safari mobile browser
Hi 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.