• Resolved tonyp83

    (@tonyp83)


    Hi,

    I’ve noticed when on a mobile, when I search and close the keyboard the results hide also. This is using autocomplete, and is the same as this issue on the official forum from a while ago.

    I’m guessing there’s a workaround or fix on autocomplete.js perhaps, but I couldn’t see anyone else has searched for this on here.

    Any advice or guidance is greatly appreciated
    T.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Tracing my way through that provided link and discussions there, their original workaround was having debug be true for mobile, but they reasoned within the scope of their library they couldn’t easily detect if mobile or not. They have the debug flag to keep the dropdown display open even when clicking/tapping away from the input.

    WordPress on the other hand has that ability, and we also filter our autocomplete configuration. So, something like this should help you out, as the debug flag would be set to true if mobile. Should be readily able to be placed in your active theme’s functions.php file.

    function wds_algolia_autocomplete_stay_open_mobile( $config ) {
    	// set debug mode to true if mobile, otherwise fall back to original value, which may also be true, but could be false.
    	$config['debug'] = wp_is_mobile() ? true : $config['debug'];
    
    	return $config;
    }
    add_filter( 'algolia_config', 'wds_algolia_autocomplete_stay_open_mobile' );
    Thread Starter tonyp83

    (@tonyp83)

    @tw2113, thanks for this snippet, that has fixed the issue and now allows you to see the results and not lose 50% screen real estate.

    As always appreciate your support on the plugin ??

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using Autocomplete on Mobile iOS, closing the keyboard hides results’ is closed to new replies.