Properly assign dropdownParent in Select2 controls. Fixes #4218

This commit is contained in:
Neel Patel 2019-04-30 12:57:17 +01:00 committed by Dave Page
parent 277bf85645
commit 34b59da526
3 changed files with 25 additions and 7 deletions

View File

@ -11,6 +11,7 @@ notes for it.
.. toctree::
:maxdepth: 1
release_notes_4_7
release_notes_4_6
release_notes_4_5
release_notes_4_4

View File

@ -0,0 +1,17 @@
***********
Version 4.7
***********
Release date: 2019-05-30
This release contains a number of new features and fixes reported since the
release of pgAdmin4 4.6
Features
********
Bug fixes
*********
| `Bug #4218 <https://redmine.postgresql.org/issues/4218>`_ - Properly assign dropdownParent in Select2 controls.

View File

@ -2017,13 +2017,6 @@ 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({
@ -2032,6 +2025,13 @@ define([
options: (this.field.get('options') || this.defaults.options),
});
// 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;
}
// If disabled then no need to show placeholder
if (data.disabled || data.mode === 'properties') {
select2Opts['placeholder'] = '';