From a7abd832bfdaa2014242dc54e494da2a463dbbb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 16 Oct 2015 13:49:19 +0200 Subject: [PATCH] Change treeview overflow on completion shown When the dropdown is shown in a treeview, if there is no enough space in the treeview, the browser adds a scrollbar to the treeview instead of expanding the height of the treeview (and let the general scrollbar managed it). This is because the treeview has an auto overflow-x which lead to set also the same to overflow-y. --- src/common.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common.js b/src/common.js index 770884aa3e..b22f6ac3d9 100644 --- a/src/common.js +++ b/src/common.js @@ -2986,8 +2986,16 @@ } } }.bind(this)); - this.menu.on('hide.bs.dropdown', function() { + // We must set the overflow of the treeview containing the input to + // visible to prevent vertical scrollbar inherited from the auto + // overflow-x + // (see http://www.w3.org/TR/css-overflow-3/#overflow-properties) + this.dropdown.on('hide.bs.dropdown', function() { this.input.focus(); + this.input.closest('.treeview').css('overflow', ''); + }.bind(this)); + this.dropdown.on('show.bs.dropdown', function() { + this.input.closest('.treeview').css('overflow', 'visible'); }.bind(this)); }, set_actions: function(actions, action_activated) {