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

Reply To: No typing when clicking on search bar

Home Forums Product Support Forums Ajax Search Pro for WordPress Support No typing when clicking on search bar Reply To: No typing when clicking on search bar

#34111
Ernest MarcinkoErnest Marcinko
Keymaster

Hi!

Thank you for the details! I have logged in and enabled the search to see what exactly is going on.

It appears that the menu script has an event listener attached to all element within the menu, which does a blur event (I assume it is for mobile devices), and it coincidentally causes the issue as well.

Luckily I think there is a way to get around it with a small custom code snippet, without disturbing the rest of the menu.

Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

add_action("wp_footer", "wp_footer_add_asp_script", 9999);
function wp_footer_add_asp_script() {
	?>
	<script>
	document.querySelectorAll('input.orig').forEach(function(el) {
		el.addEventListener('click', function(e){
			e.stopPropagation();
		});
	});
	</script>
	<?php
}

I also noticed some custom margin/padding added via the menu styling to the search input. To negate that, use this custom CSS:

.asp_w>a {
    margin: 0 !important;
    padding: 0 !important;
}

I hope this helps!