Skip to content

Commit

Permalink
Merge branch 'MDL-59867-32' of git://github.com/damyon/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_32_STABLE
  • Loading branch information
David Monllao committed Sep 12, 2017
2 parents 1b81de7 + 6961e88 commit 52155a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/amd/build/form-autocomplete.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions lib/amd/src/form-autocomplete.js
Expand Up @@ -37,6 +37,8 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
UP: 38
};

var uniqueId = $.now();

/**
* Make an item in the selection list "active".
*
Expand Down Expand Up @@ -774,11 +776,15 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Find or generate some ids.
var state = {
selectId: originalSelect.attr('id'),
inputId: 'form_autocomplete_input-' + $.now(),
suggestionsId: 'form_autocomplete_suggestions-' + $.now(),
selectionId: 'form_autocomplete_selection-' + $.now(),
downArrowId: 'form_autocomplete_downarrow-' + $.now()
inputId: 'form_autocomplete_input-' + uniqueId,
suggestionsId: 'form_autocomplete_suggestions-' + uniqueId,
selectionId: 'form_autocomplete_selection-' + uniqueId,
downArrowId: 'form_autocomplete_downarrow-' + uniqueId
};

// Increment the unique counter so we don't get duplicates ever.
uniqueId++;

options.multiple = originalSelect.attr('multiple');

var originalLabel = $('[for=' + state.selectId + ']');
Expand Down

0 comments on commit 52155a2

Please sign in to comment.