From 34b59da526415e3f383a72d9f6c0233aaa406317 Mon Sep 17 00:00:00 2001 From: Neel Patel Date: Tue, 30 Apr 2019 12:57:17 +0100 Subject: [PATCH] Properly assign dropdownParent in Select2 controls. Fixes #4218 --- docs/en_US/release_notes.rst | 1 + docs/en_US/release_notes_4_7.rst | 17 +++++++++++++++++ web/pgadmin/static/js/backform.pgadmin.js | 14 +++++++------- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 docs/en_US/release_notes_4_7.rst diff --git a/docs/en_US/release_notes.rst b/docs/en_US/release_notes.rst index d7b2c13ca..41921ac7e 100644 --- a/docs/en_US/release_notes.rst +++ b/docs/en_US/release_notes.rst @@ -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 diff --git a/docs/en_US/release_notes_4_7.rst b/docs/en_US/release_notes_4_7.rst new file mode 100644 index 000000000..9d9e4076b --- /dev/null +++ b/docs/en_US/release_notes_4_7.rst @@ -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 `_ - Properly assign dropdownParent in Select2 controls. diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js index ae762f6e3..3647dfbd5 100644 --- a/web/pgadmin/static/js/backform.pgadmin.js +++ b/web/pgadmin/static/js/backform.pgadmin.js @@ -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'] = '';