JSFiddle - React, Tailwind, and code Playground

by NicholasRBowers

JavaScript

(function pacSelectFirst(input) {
      // Store the original event binding function
      var _addEventListener = (input.addEventListener) ? input.addEventListener : input.attachEvent;

      function addEventListenerWrapper(type, listener) {
        // Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected, and then trigger the original listener.
        if (type === "keydown") {
          var orig_listener = listener;
          listener = function (event) {
            var suggestion_selected = $(".pac-item-selected").length > 0;
            if (event.which === 13 && !suggestion_selected && block) {
              var simulated_downarrow = $.Event("keydown", {
                keyCode: 40,
                which: 40
              });
              orig_listener.apply(input, [simulated_downarrow]);
            }
            orig_listener.apply(input, [event]);
          };
        }
        _addEventListener.apply(input, [type, listener]);
      }
      input.addEventListener = addEventListenerWrapper;
      input.attachEvent = addEventListenerWrapper;
    })(input);




// split



    google.maps.event.addListener(autocomplete, 'place_changed', function () {
      circle.removeClass('flip');
      side1.removeClass('bounce').css('opacity', 0);
      mapCanvas.css('opacity', 1);
      var place = autocomplete.getPlace();
      if (place.geometry) { // Check to see if we have the appropriate information to display the place.
        var displayAddress = '';
        var address = [];
        if (place.address_components) {                                       // If the address components exist,
          for (var i = 0; i < place.address_components.length; i++) {         // Iterate through address_component types
            if (place.address_components[i].short_name) {
              if (place.address_components[i].types[0] === 'street_number') { // If there is street number information,
                address[0] =...