Skip to content

Instantly share code, notes, and snippets.

@daronspence
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daronspence/9179023c8e956e99974e to your computer and use it in GitHub Desktop.
Save daronspence/9179023c8e956e99974e to your computer and use it in GitHub Desktop.
ACF G-Map Bug Fix
// LINE 3927 of input.js
/////////////////////////////
// OLD CODE
////////////////////////////
// update inputs
this.$el.find('.input-lat').val( lat );
this.$el.find('.input-lng').val( lng ).trigger('change');
////////////////////////////
// NEW CODE
///////////////////////////
var oldLat = this.$el.find('.input-lat').val();
var oldLng = this.$el.find('.input-lng').val( lng );
// update inputs
this.$el.find('.input-lat').val( lat );
this.$el.find('.input-lng').val( lng );
// fire the change trigger only on real changes
if (oldLat != lat || oldLng != lng) {
this.$el.find('.input-lng').trigger('change');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment