diff --git a/inline_entity_form.module b/inline_entity_form.module
index ad18782..91816a1 100644
--- a/inline_entity_form.module
+++ b/inline_entity_form.module
@@ -62,11 +62,10 @@ function inline_entity_form_reference_form($handler, $reference_form, &$form_sta
 
   $reference_form['#title'] = t('Add existing @type_singular', array('@type_singular' => $labels['singular']));
   $reference_form['entity_id'] = array(
-    '#type' => 'textfield',
+    '#type' => 'entity_autocomplete',
     '#title' => t('@label', array('@label' => ucwords($labels['singular']))),
-    '#autocomplete_route_name' => 'inline_entity_form.autocomplete',
-    '#autocomplete_route_parameters' => ['entity_type_id' => $instance->getTargetEntityTypeId(), 'field_name' => $instance->getName(), 'bundle' => $instance->getTargetBundle()],
-    '#element_validate' => array('_inline_entity_form_autocomplete_validate'),
+    '#target_type' => $instance->getSetting('target_type'),
+    '#selection_settings' => ['target_bundles' => $instance->getSetting('handler_settings')['target_bundles']],
     '#required' => TRUE,
     '#maxlength' => 255,
   );
@@ -112,20 +111,6 @@ function inline_entity_form_reference_form($handler, $reference_form, &$form_sta
 }
 
 /**
- * #element_validate callback for the IEF autocomplete field.
- */
-function _inline_entity_form_autocomplete_validate($element, FormStateInterface $form_state, $form) {
-  $value = '';
-  if (!empty($element['#value'])) {
-    // Take "label (entity id)', match the id from parenthesis.
-    if (preg_match("/.+\((\d+)\)/", $element['#value'], $matches)) {
-      $value = $matches[1];
-    }
-  }
-  $form_state->setValueForElement($element, $value);
-}
-
-/**
  * Validates the form for adding existing entities.
  *
  * @param $reference_form
diff --git a/inline_entity_form.routing.yml b/inline_entity_form.routing.yml
deleted file mode 100644
index 9456a00..0000000
--- a/inline_entity_form.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-inline_entity_form.autocomplete:
-  path: inline_entity_form/autocomplete/{entity_type_id}/{field_name}/{bundle}
-  defaults:
-    _controller: '\Drupal\inline_entity_form\Controller\AutocompleteController::autocomplete'
-    _title: 'Inline Entity Form Autocomplete'
-  requirements:
-    _access: 'TRUE'
diff --git a/src/Controller/AutocompleteController.php b/src/Controller/AutocompleteController.php
deleted file mode 100644
index eca5087..0000000
--- a/src/Controller/AutocompleteController.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\inline_entity_form\Controller\AutocompleteController.
- */
-
-namespace Drupal\inline_entity_form\Controller;
-
-use Drupal\Component\Utility\Html;
-use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\JsonResponse;
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
-
-/**
- * Defines the autocompletion controller method.
- */
-class AutocompleteController implements ContainerInjectionInterface {
-
-  /**
-   * Entity manager service.
-   *
-   * @var \Drupal\Core\Entity\EntityManagerInterface
-   */
-  protected $entityManager;
-
-  /**
-   * Selection manager service.
-   *
-   * @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface
-   */
-  protected $selectionManager;
-
-  /**
-   * Constructs a new AutocompleteController object.
-   *
-   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
-   */
-  public function __construct(EntityManagerInterface $entity_manager, SelectionPluginManagerInterface $selection_manager) {
-    $this->entityManager = $entity_manager;
-    $this->selectionManager = $selection_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('entity.manager'),
-      $container->get('plugin.manager.entity_reference_selection')
-    );
-  }
-
-  /**
-   * Handles the response for inline entity form autocompletion.
-   *
-   * @return \Symfony\Component\HttpFoundation\JsonResponse
-   */
-  public function autocomplete($entity_type_id, $field_name, $bundle, Request $request) {
-    $string = $request->query->get('q');
-    $fields = $this->entityManager->getFieldDefinitions($entity_type_id, $bundle);
-    $widget = $this->entityManager
-      ->getStorage('entity_form_display')
-      ->load($entity_type_id . '.' . $bundle . '.default')
-      ->getComponent($field_name);
-    // The path was passed invalid parameters, or the string is empty.
-    // strlen() is used instead of empty() since '0' is a valid value.
-    if (!isset($fields[$field_name]) || !$widget || !strlen($string)) {
-      throw new AccessDeniedHttpException();
-    }
-
-    $field = $fields[$field_name];
-    $results = array();
-    if ($field->getType() == 'entity_reference') {
-      /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
-      $handler = $this->selectionManager->getSelectionHandler($field);
-      $entity_labels = $handler->getReferenceableEntities($string, $widget['settings']['match_operator'], 10);
-
-      foreach ($entity_labels as $bundle => $labels) {
-        // Loop through each entity type, and autocomplete with its titles.
-        foreach ($labels as $entity_id => $label) {
-          // entityreference has already check_plain-ed the title.
-          $results[] = t('!label (!entity_id)', array('!label' => $label, '!entity_id' => $entity_id));
-        }
-      }
-    }
-
-    $matches = array();
-    foreach ($results as $result) {
-      // Strip things like starting/trailing white spaces, line breaks and tags.
-      $key = preg_replace('/\s\s+/', ' ', str_replace("\n", '', trim(Html::decodeEntities(strip_tags($result)))));
-      $matches[] = ['value' => $key, 'label' => '<div class="reference-autocomplete">' . $result . '</div>'];
-    }
-
-    return new JsonResponse($matches);
-  }
-
-}
diff --git a/src/Tests/InlineEntityFormComplexWebTest.php b/src/Tests/InlineEntityFormComplexWebTest.php
index f341bae..fe8f8e2 100644
--- a/src/Tests/InlineEntityFormComplexWebTest.php
+++ b/src/Tests/InlineEntityFormComplexWebTest.php
@@ -96,7 +96,7 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
     $this->assertFieldByXpath('//input[@type="submit" and @value="Add existing node"]', NULL, 'Found "Add existing node" submit button');
 
     // Now submit 'Add new node' button.
-    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add new node"]'));
+    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add new node" and @data-drupal-selector="edit-multi-actions-ief-add"]'));
 
     $this->assertFieldByName('multi[form][inline_entity_form][title][0][value]', NULL, 'Title field on inline form exists.');
     $this->assertFieldByName('multi[form][inline_entity_form][first_name][0][value]', NULL, 'First name field on inline form exists.');
@@ -106,7 +106,7 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
 
     // Now submit 'Add Existing node' button.
     $this->drupalGet($this->formContentAddUrl);
-    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add existing node"]'));
+    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add existing node" and @data-drupal-selector="edit-multi-actions-ief-add-existing"]'));
 
     $this->assertFieldByName('multi[form][entity_id]', NULL, 'Existing entity reference autocomplete field found.');
     $this->assertFieldByXpath('//input[@type="submit" and @value="Add node"]', NULL, 'Found "Add node" submit button');
@@ -121,10 +121,10 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
     $this->setAllowExisting(TRUE);
     $this->drupalGet($this->formContentAddUrl);
 
-    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add new node"]'));
+    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add new node" and @data-drupal-selector="edit-multi-actions-ief-add"]'));
     $this->assertResponse(200, 'Opening new inline form was successful.');
 
-    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Create node"]'));
+    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Create node" and @data-drupal-selector="edit-multi-form-inline-entity-form-actions-ief-add-save"]'));
     $this->assertResponse(200, 'Submitting empty form was successful.');
     $this->assertText('First name field is required.', 'Validation failed for empty "First name" field.');
     $this->assertText('Last name field is required.', 'Validation failed for empty "Last name" field.');
@@ -132,7 +132,7 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
 
     // Create ief_reference_type node in IEF.
     $this->drupalGet($this->formContentAddUrl);
-    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add new node"]'));
+    $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add new node" and @data-drupal-selector="edit-multi-actions-ief-add"]'));
     $this->assertResponse(200, 'Opening new inline form was successful.');
 
     $edit = [
@@ -140,7 +140,7 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
       'multi[form][inline_entity_form][first_name][0][value]' => 'John',
       'multi[form][inline_entity_form][last_name][0][value]' => 'Doe',
     ];
-    $this->drupalPostAjaxForm(NULL, $edit, $this->getButtonName('//input[@type="submit" and @value="Create node"]'));
+    $this->drupalPostAjaxForm(NULL, $edit, $this->getButtonName('//input[@type="submit" and @value="Create node" and @data-drupal-selector="edit-multi-form-inline-entity-form-actions-ief-add-save"]'));
     $this->assertResponse(200, 'Creating node via inline form was successful.');
 
     // Tests if correct fields appear in the table.
@@ -273,18 +273,27 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
 
     // Create three ief_reference_type entities.
     $referenceNodes = $this->createReferenceContent(3);
-    // Create ief_test_complex node with first ief_reference_type node.
+
+    // Create a node for every bundle available.
+    $bundle_nodes = $this->createNodeForEveryBundle();
+
+    // Create ief_test_complex node with first ief_reference_type node and first
+    // node from bundle nodes.
     $this->drupalCreateNode([
       'type' => 'ief_test_complex',
       'title' => 'Some title',
       'multi' => [1],
+      'all_bundles' => key($bundle_nodes),
     ]);
+    // Remove first node since we already added it.
+    unset($bundle_nodes[key($bundle_nodes)]);
+
     $parent_node = $this->drupalGetNodeByTitle('Some title', TRUE);
 
     // Add remaining existing reference nodes.
     $this->drupalGet('node/' . $parent_node->id() . '/edit');
     for ($i = 2; $i <= 3; $i++) {
-      $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add existing node"]'));
+      $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add existing node" and @data-drupal-selector="edit-multi-actions-ief-add-existing"]'));
       $this->assertResponse(200, 'Opening reference form was successful.');
       $title = 'Some reference ' . $i;
       $edit = [
@@ -293,6 +302,16 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
       $this->drupalPostAjaxForm(NULL, $edit, $this->getButtonName('//input[@type="submit" and @data-drupal-selector="edit-multi-form-actions-ief-reference-save"]'));
       $this->assertResponse(200, 'Adding new referenced entity was successful.');
     }
+    // Add all remaining nodes from all bundles.
+    foreach ($bundle_nodes as $id => $title) {
+      $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add existing node" and @data-drupal-selector="edit-all-bundles-actions-ief-add-existing"]'));
+      $this->assertResponse(200, 'Opening reference form was successful.');
+      $edit = [
+        'all_bundles[form][entity_id]' => $title . ' (' . $id . ')',
+      ];
+      $this->drupalPostAjaxForm(NULL, $edit, $this->getButtonName('//input[@type="submit" and @data-drupal-selector="edit-all-bundles-form-actions-ief-reference-save"]'));
+      $this->assertResponse(200, 'Adding new referenced entity was successful.');
+    }
     // Save the node.
     $this->drupalPostForm(NULL, [], t('Save'));
     $this->assertResponse(200, 'Saving parent for was successful.');
@@ -303,6 +322,13 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
       $cell = $this->xpath('//table[@id="ief-entity-table-edit-multi-entities"]/tbody/tr[' . $i . ']/td[@class="inline-entity-form-node-label"]');
       $this->assertTrue($cell[0] == 'Some reference ' . $i, 'Found reference node title "Some reference ' . $i .'" in the IEF table.');
     }
+    // Check if all remaining nodes from all bundles are referenced.
+    $count = 2;
+    foreach ($bundle_nodes as $id => $title) {
+      $cell = $this->xpath('//table[@id="ief-entity-table-edit-all-bundles-entities"]/tbody/tr[' . $count . ']/td[@class="inline-entity-form-node-label"]');
+      $this->assertTrue($cell[0] == $title, 'Found reference node title "' . $title . '" in the IEF table.');
+      $count++;
+    }
   }
 
   /**
@@ -366,4 +392,22 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
     return $retval;
   }
 
+  /**
+   * Creates a node for every node bundle.
+   *
+   * @return array
+   *   Array of node titles keyed by ids.
+   */
+  protected function createNodeForEveryBundle() {
+    $retval = [];
+    $bundles = $this->container->get('entity.manager')->getBundleInfo('node');
+    foreach ($bundles as $id => $value) {
+      $this->drupalCreateNode(['type' => $id, 'title' => $value['label']]);
+      $node = $this->drupalGetNodeByTitle($value['label']);
+      $this->assertTrue($node, 'Created node "' . $node->label() . '"');
+      $retval[$node->id()] = $value['label'];
+    }
+    return $retval;
+  }
+
 }
diff --git a/tests/modules/inline_entity_form_test/config/install/core.entity_form_display.node.ief_test_complex.default.yml b/tests/modules/inline_entity_form_test/config/install/core.entity_form_display.node.ief_test_complex.default.yml
index 4372478..a808119 100644
--- a/tests/modules/inline_entity_form_test/config/install/core.entity_form_display.node.ief_test_complex.default.yml
+++ b/tests/modules/inline_entity_form_test/config/install/core.entity_form_display.node.ief_test_complex.default.yml
@@ -50,4 +50,14 @@ content:
       label_plural: ''
     third_party_settings: {  }
     type: inline_entity_form_complex
+  all_bundles:
+    weight: 30
+    settings:
+      match_operator: CONTAINS
+      allow_existing: true
+      override_labels: false
+      label_singular: ''
+      label_plural: ''
+    third_party_settings: {  }
+    type: inline_entity_form_complex
 hidden: {  }
diff --git a/tests/modules/inline_entity_form_test/config/install/field.field.node.ief_test_complex.all_bundles.yml b/tests/modules/inline_entity_form_test/config/install/field.field.node.ief_test_complex.all_bundles.yml
new file mode 100644
index 0000000..60c9822
--- /dev/null
+++ b/tests/modules/inline_entity_form_test/config/install/field.field.node.ief_test_complex.all_bundles.yml
@@ -0,0 +1,30 @@
+langcode: und
+status: true
+dependencies:
+  config:
+    - field.storage.node.all_bundles
+    - node.type.ief_test_complex
+  module:
+    - inline_entity_form_test
+    - entity_reference
+  enforced:
+    module:
+      - inline_entity_form_test
+id: node.ief_test_complex.all_bundles
+field_name: all_bundles
+entity_type: node
+bundle: ief_test_complex
+label: All bundles
+description: 'Reference nodes from all available bundles.'
+required: false
+translatable: false
+default_value: {  }
+default_value_callback: ''
+settings:
+  handler: default:node
+  handler_settings:
+    target_bundles: null
+    sort:
+      field: _none
+third_party_settings: {  }
+field_type: entity_reference
diff --git a/tests/modules/inline_entity_form_test/config/install/field.storage.node.all_bundles.yml b/tests/modules/inline_entity_form_test/config/install/field.storage.node.all_bundles.yml
new file mode 100644
index 0000000..0a72137
--- /dev/null
+++ b/tests/modules/inline_entity_form_test/config/install/field.storage.node.all_bundles.yml
@@ -0,0 +1,22 @@
+langcode: und
+status: true
+dependencies:
+  module:
+    - inline_entity_form_test
+    - entity_reference
+    - node
+  enforced:
+    module:
+      - inline_entity_form_test
+id: node.all_bundles
+field_name: all_bundles
+entity_type: node
+type: entity_reference
+settings:
+  target_type: node
+module: entity_reference
+locked: false
+cardinality: -1
+translatable: false
+indexes: {  }
+persist_with_no_fields: false
