Hi @jubilo
You can try this code snippet. It will make the search results and details panel visible as long as the input has the entered phrase. This should solve the problem you mentioned.
<?php add_action( 'wp_footer', function() { ?>
<script type="text/javascript">
(function ($) {
$(document).ajaxSuccess(function (event, request, settings) {
fibosearch_visibility(event, request, settings);
});
$('.dgwt-wcas-search-input').on( 'input', null, null, function() {
if ( $(this).val().length < 3 ) {
jQuery('html').removeClass('fibosearch-visible');
}
});
let timeout;
$('.dgwt-wcas-search-wrapp').on( 'click', '.dgwt-wcas-preloader', function(e) {
if ( timeout !== undefined ) {
clearTimeout( timeout );
}
timeout = setTimeout(function() {
$('html').removeClass('fibosearch-visible');
}, 300 );
});
}(jQuery));
function fibosearch_visibility(event, request, settings) {
if (typeof settings.url == 'string' && new RegExp('dgwt_wcas_ajax_search').test(settings.url)) {
if ( $('.dgwt-wcas-search-wrapp' ).hasClass('dgwt-wcas-search-filled', 'dgwt-wcas-active') ) {
$('html').addClass('fibosearch-visible');
} else {
$('html').removeClass('fibosearch-visible');
}
}
}
</script>
<style type="text/css">
.fibosearch-visible .dgwt-wcas-suggestions-wrapp,
.fibosearch-visible .dgwt-wcas-details-wrapp{
display: block !important;
}
.fibosearch-visible .dgwt-wcas-details-wrapp,
.fibosearch-visible .dgwt-wcas-suggestions-wrapp {
border-color: #fff;
padding-top: 10px;
padding-bottom: 10px;
}
.fibosearch-visible .dgwt-wcas-details-inner,
.fibosearch-visible .dgwt-wcas-suggestions-wrapp > .dgwt-wcas-suggestion {
padding-left: 20px;
padding-right: 20px;
}
</style>
<?php }, 9999 );
You have two ways to add this code to your theme:
1. Open the functions.php
in your child theme and add the code at the end.
2. or install the Code Snippets plugin and apply this code as a snippet.
Regards,
Kris