From 6016a5ee989a8f3f56c4a03994eb57989c3c0717 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Tue, 9 Apr 2019 12:09:25 +0530 Subject: [PATCH] Fix an issue where the dropdown becomes misaligned/displaced. Fixes #4138 --- docs/en_US/release_notes.rst | 1 + docs/en_US/release_notes_4_6.rst | 17 +++++++++++++++++ web/pgadmin/static/js/backform.pgadmin.js | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 docs/en_US/release_notes_4_6.rst diff --git a/docs/en_US/release_notes.rst b/docs/en_US/release_notes.rst index 2ca5832cb..d7b2c13ca 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_6 release_notes_4_5 release_notes_4_4 release_notes_4_3 diff --git a/docs/en_US/release_notes_4_6.rst b/docs/en_US/release_notes_4_6.rst new file mode 100644 index 000000000..54ff79475 --- /dev/null +++ b/docs/en_US/release_notes_4_6.rst @@ -0,0 +1,17 @@ +*********** +Version 4.6 +*********** + +Release date: 2019-05-02 + +This release contains a number of new features and fixes reported since the +release of pgAdmin4 4.5 + +Features +******** + + +Bug fixes +********* + +| `Bug #4138 `_ - Fix an issue where the dropdown becomes misaligned/displaced. \ No newline at end of file diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js index ef69a8d94..8ace3b326 100644 --- a/web/pgadmin/static/js/backform.pgadmin.js +++ b/web/pgadmin/static/js/backform.pgadmin.js @@ -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({