Uncaught TypeError: Cannot set property '_renderItem' of undefined (using Jquery Combobox and Geocoder)

Uncaught TypeError: Cannot set property '_renderItem' of undefined (using Jquery Combobox and Geocoder)

I have problems with gmaps api instant (geocoder) and jquery autocomplete combobox. If one of the two is in the product, works perfectly. But if the two coexist in the same page, break, throwing this error in console:

Cannot set property '_renderItem' of undefined

This was the line that contains this code:
  
  1. input.data( "autocomplete" )._renderItem = function( ul, item ) {
  2. return $( "<li>" )
  3. .data( "item.autocomplete", item )
  4. .append( "<a>" + item.label + "</a>" )
  5. .appendTo( ul );
  6. });
Looking around, I found a possible solution:

  1. var obj = input.data( "autocomplete" );
  2. obj && (obj._renderItem = function( ul, item ) {
  3. return $( "<li>" )
  4. .data( "item.autocomplete", item )
  5. .append( "<a>" + item.label + "</a>" )
  6. .appendTo( ul );
  7. });
But that only makes the map going smoothly, but the combobox still malfunctioning.