When using a 3rd party keyboard like Swiftkey javascript events like keypress don't register. For example Google maps autocomplete won't work https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete
Seems like an iOS bug but any ideas on how I can get around this?
You can just manually fire keypress events.
$textBox = $('#text_box') // We don't want to search the dom more than we have to.
setInterval(function(){
$textBox.trigger('keypress')
}, 500)
This is definitely a messy solution, but it should get autocomplete to work, as well as other handlers that wait for keypresses.
Would this work?
jQuery('#text_box').on('input propertychange paste', function() {
// text has changed...
});
JSFIDDLE
I found a solution using setInterval and the answered method from here Trigger Google Places Autocomplete
setInterval(function() {
if ($('input#mapSearch').is(':focus')) {
google.maps.event.trigger(document.getElementById('mapSearch'), 'focus', {});
}
}, 500);