Skip to content

Instantly share code, notes, and snippets.

@ajuliano
Created October 4, 2016 22:08
Show Gist options
  • Save ajuliano/b1f2c09f4d570253c0630e2a705c27ca to your computer and use it in GitHub Desktop.
Save ajuliano/b1f2c09f4d570253c0630e2a705c27ca to your computer and use it in GitHub Desktop.
The autocomplete form in the wpadverts-mal plugin triggers the submit button when pushing Enter when a location is selected in the dropdown, but the location is not saved.
/*
* Added on line 139 in the file wpadverts-mal/assets/js/map-single.js in plugin version 1.1.1
*/
google.maps.event.addDomListener(input, 'keydown', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment