Forums › Forums › Search & Filter Pro › Combobox not working in Safari (but working in Chrome, IE, Firefox)
- This topic has 7 replies, 2 voices, and was last updated 10 years, 2 months ago by Ross.
-
Anonymous(Private) August 18, 2014 at 9:37 pm #3698
When I refresh the page, the comboboxes are there and styled correctly. I was able to put an alert in the (minified) chosen.jquery.min.js, and was able to see that the combobox was indeed being created. However, after maybe half a second, the comboboxes disappear and the initial options show up. Is anyone else experiencing this problem? I’m not getting any errors.
Ross Moderator(Private) August 19, 2014 at 1:42 pm #3729Hey Alex, are you using Ajax? Is your search form inside your Ajax content selector? Your search form should be outside the ajax content area so I’m hoping its a simple fix 😉
Anonymous(Private) August 19, 2014 at 5:22 pm #3761Hi Ross,
It’s not, unfortunately. Here is my search.php page below. My search form is the<?php get_sidebar('filter'); ?>
widget.<?php /** * The template for displaying search results pages. * * @package _s */ get_header(); ?> <section id="primary" class="content-area"> <main id="main" class="site-main media" role="main"> <?php get_sidebar('filter'); ?> <?php if ( have_posts() ) : ?> <div class="entry-content"> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /** * Run the loop for the search to output the results. * If you want to overload this in a child theme then include a file * called content-search.php and that will be used instead. */ get_template_part( 'content', 'search' ); ?> <?php endwhile; ?> </div> <?php else : ?> <div class="entry-content"> <p class="no-results"><?php _e( 'It seems we can’t find what you’re looking for. Broaden your search by eliminating a selection or try a general search.', '_s' ); ?></p> <?php get_search_form(); ?> </div> <?php endif; ?> </main><!-- #main --> </section><!-- #primary --> <div id="pagination-holder"> <?php paginate(); ?> </div> <?php get_footer(); ?>
Anonymous(Private) August 19, 2014 at 9:10 pm #3776Update:
So I found the issue… and I’m not sure if that I did to “solve” it is legit. Under
window.addEventListener("popstate", function(e)
, I was able to comment out// var $data_obj_get = $(data);
, and now my comboboxes work in Safari… but I have no idea why it’s only messing up Safari, or why the data, which seems to be the html of the entire page, is being recreated at all.Am I creating less obvious but worse issues by commenting out that line? My page is remaining at .5 opacity if that’s any clue. Again, no other browsers appear to be affected at all.
Anonymous(Private) August 19, 2014 at 9:43 pm #3779Alright, so last update… good news! Please excuse my explanation if it’s unclear at all, I’m a bit of a n00bie dev.
The issue was occurring on a callback. The popstate was being called on Safari upon page reload, but not in Firefox or any other browser (surprisingly, Chrome wasn’t having an issue). By commenting out
var $data_obj_get = $(data);
, I stopped the code from re-adding the html (below)var $ajaxed_search_form_get = $data_obj_get.find('*[data-sf-form-id='+form_id+']'); $thisform.html($ajaxed_search_form_get.html());
and as a result,
initSearchForms();
was not being overridden by this bit of code. By callinginitSearchForms();
again after the two lines of code above, and uncommentingvar $data_obj_get = $(data);
, the comboboxes were being created after the html purge and re-write.So all is well! Thanks!
Ross Moderator(Private) August 20, 2014 at 1:11 pm #3797Hey Alex glad you got this working, I will do some testing with your suggestions and hopefully get it resolved in the next update 🙂
Thanks for your work on it!
-
AuthorPosts