Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › plugin causing high server resource consumption › Reply To: plugin causing high server resource consumption
I have looked up the documentation of the library, which implements this feature, and it seems like that is not possible. A soon as the user clicks anywhere on the page, the container is fully deleted from the DOM tree, and reset when focused.
I checked if there are maybe options to somehow control the opening/closing, that is possible and very simple. However if the user clicks anywhere outside the selection container, it is automatically closed, and there is no option to prevent that.
You can try a custom script, something like this:
add_action('wp_footer', 'asp_add_footer_script', 9999);
function asp_add_footer_script() {
?>
<script>
(function($){
$('.asp_goselect2').asp_select2('open');
setTimeout(function(){
$('.asp_goselect2').asp_select2('open');
}, 500);
$('body').on('click', function(){
$('.asp_goselect2').asp_select2('open');
});
}(jQuery));
</script>
<?php
}
This may keep it forcefully open, but it will not work for all of the cases.