mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 11:57:37 -02:30
don't toggle the dropdown when removing items from multiselect fields
see: #5466
This commit is contained in:
@@ -662,6 +662,20 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
|
|||||||
|
|
||||||
$(element).select2(config);
|
$(element).select2(config);
|
||||||
|
|
||||||
|
// Don't toggle the dropdown when a multiselect option is
|
||||||
|
// being removed
|
||||||
|
if (multiple) {
|
||||||
|
$(element).on('select2:opening', (e) => {
|
||||||
|
var unselecting = $(e.target).data('select2-unselecting');
|
||||||
|
if (unselecting === true) {
|
||||||
|
$(e.target).removeData('select2-unselecting');
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}).on('select2:unselecting', (e) => {
|
||||||
|
$(e.target).data('select2-unselecting', true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
for (var d = 0; d < $(element + " option").length; d++) {
|
for (var d = 0; d < $(element + " option").length; d++) {
|
||||||
var item = $(element + " option")[d];
|
var item = $(element + " option")[d];
|
||||||
|
|||||||
Reference in New Issue
Block a user