Forums › Forums › Search & Filter Pro › Stop layout from changing when: ‘Update the Search Form on user interaction’
- This topic has 7 replies, 2 voices, and was last updated 4 years, 9 months ago by Trevor.
-
Anonymous(Private) February 12, 2020 at 11:54 am #233768
I would like to use the ‘Auto count’ with ‘Update the Search Form on user interaction’ enabled. It updates all items correctly but changes the layout of the form. I want the form shown the same as it is before selecting an item from the dropdown. This is the (not finished yet) site: https://yourvalleyvisit.es/ the search form is placed on the homepage.
Since I don’t have php experience I have been trying to achieve this in the layout and search-filter CSS but can’t figure it out.
I hope that someone can help me out. Thanks heaps!Trevor(Private) February 13, 2020 at 12:45 pm #233861I found where your theme is adding this. Your theme is adding this in part of a custom script file:
$("select").each(function(){ if($(this).css('display') != 'none') { $(this).wrap( '<div class="selection-box"></div>' ); } });
Does your theme allow you to add a script to the page?
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxformstart", ".searchandfilter", function(){ $(".searchandfilter select").each(function(){ if($(this).css('display') != 'none') { $(this).wrap( '<div class="selection-box"></div>' ); } }); }(jQuery));</script>
I am not sure that is correct.
A word of caution. This will add back in the styling, but the select box widths may well change to the content in the changing, so you may have to set up some min-width CSS rules.
Anonymous(Private) February 13, 2020 at 3:41 pm #233876I have added it below the script that you have found. In theme/framework/js/custom.js. Is that what I should’ve done? The layout doesn’t change anymore after selecting something so that’s great. Only now it has got the layout that I tried to get rid of (the one it used to change to) and so do my other search forms.
You’re obviously on to something.
I hope that you have a suggestion for fixing that layout situation, then it’s perfect! -
AuthorPosts