Fix an issue where the dropdown becomes misaligned/displaced. Fixes #4138

This commit is contained in:
Murtuza Zabuawala
2019-04-09 12:09:25 +05:30
committed by Akshay Joshi
parent 490999f528
commit 6016a5ee98
3 changed files with 27 additions and 0 deletions

View File

@@ -1910,6 +1910,7 @@ define([
multiple: false,
emptyOptions: false,
preserveSelectionOrder: false,
isDropdownParent: false,
},
}),
@@ -1987,6 +1988,7 @@ define([
multiple: false,
emptyOptions: false,
preserveSelectionOrder: false,
isDropdownParent: false,
});
// Evaluate the disabled, visible, and required option
@@ -2015,6 +2017,13 @@ define([
if (!data.visible)
this.$el.addClass(Backform.hiddenClassName);
// Dropdown body can be render at user given location
// If isDropdownParent flag is set to true then, By default we will
// display it on the control itself.
if (data.select2.isDropdownParent) {
select2Opts.dropdownParent = data.select2.dropdownParent || this.$el;
}
this.$el.html(this.template(data)).addClass(field.name);
var select2Opts = _.extend({