This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Search in menu is disabled

#25799
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Thank you for the details. It seems like there is a 3rd party script that simply negates the focus of the menu elements upon clicking them, this includes the search bar as well, since it is part of the menu in that case. I am not sure which one is it exactly, but it might be possible to somehow correct that via a custom script.

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_filter( 'wp_footer', 'asp_try_fixing_focus' );
function asp_try_fixing_focus() {
	?>
	<script>
	jQuery('input.orig').on('mouseup', function(){
		var $n = jQuery(this); 
		setTimeout(function(){
			$n.focus();
		}, 40);
	});
	</script>
	<?php
}

I am not sure if this will work correctly in all cases, but should do something for sure. The optimal solution would be to turn off or modify that other script so that the input does not immediately loose focus once clicked.