Currently, I have a loop set up to go through a list of names in order to check if the user's search query (stored as variable "s") matches any of the names. This loop functions perfectly on desktops and laptops, but unfortunately, it does not work on iOS or Android devices. I am aware that according to the documentation for match() function, it is compatible with these devices, as mentioned here.
If you want to see the code in action, you can visit the link here.
Here is how my loop currently looks:
var s = search.val();
// checking if 's' has at least 3 characters
if ( 3 <= s.length ) {
doctors.each(function() {
var $this = $( this ),
name = $this.find( '.vca-doctor-name' ).text().toLowerCase().trim();
if ( null !== name.match( s ) ) {
$this.parents( '.vca-physician-wrapper' ).fadeIn( 'fast' );
}
else {
$this.parents( '.vca-physician-wrapper' ).fadeOut( 'fast' );
}
});
reset.fadeIn( 'fast' );
$( '.vca-physician-wrapper' ).addClass( 'float' );
}
else {
doReset();
}
I appreciate any assistance you can provide on this matter!