Problem/Motivation

#2418017-125: Implement autocomplete UI for the link widget from @yched

$autocomplete is :
var $autocomplete = $(context).find('input.form-autocomplete').once('autocomplete');,
so it contains all autocomplete elements in the context for the current Drupal.behaviors.attach() call.
Then the code builds one single autocomplete.options for all of them, and attaches it to all the autocompletes in $autocomplete. Thus, unless I'm missing something, the data-autocomplete-first-character-blacklist set in one autocomplete spills over to the all of the others ?

Proposed resolution

Remaining tasks

Make a test that shows the bug
or
steps to reproduce the bug

User interface changes

API changes

Comments

Wim Leers’s picture

Make a test that shows the bug

Impossible since we don't have front-end tests.

yched’s picture

Steps to reproduce the bug :

I guess this needs a form with two autocomplete fields each having different "first-character-blacklist" property,
I think the configuration of one of the textfield will leak onto the other (not sure which one wins, first or second)

YesCT’s picture

@Wim Leers yeah, we can't add a front-end test to core... but we could write one (a behat test?) that we could use locally. That might be helpful as we work on this issue.

anon’s picture

I think it's a bigger problem.

There are no "instances" at all when using autocomplete. All elements will share the same settings, and that makes it impossible to override for just one element.

anon’s picture

Component: menu system » javascript

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.