summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-11-10 15:55:05 -0800
committerFrederic Guillot <fred@kanboard.net>2017-11-10 15:55:05 -0800
commit63dbab199c6709aafa77f409f87202443550badf (patch)
tree0af4544460ef26e6f64faf80ff99d0a6cdba8571 /assets/js/components
parentb763966595d6190d310c899ae35712948d62d4c3 (diff)
Fix project dropdown visibility when page is scrolled down
Diffstat (limited to 'assets/js/components')
-rw-r--r--assets/js/components/select-dropdown-autocomplete.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/assets/js/components/select-dropdown-autocomplete.js b/assets/js/components/select-dropdown-autocomplete.js
index 188dd5e9..8d1cd13d 100644
--- a/assets/js/components/select-dropdown-autocomplete.js
+++ b/assets/js/components/select-dropdown-autocomplete.js
@@ -183,6 +183,7 @@ KB.component('select-dropdown-autocomplete', function(containerElement, options)
function buildDropdownMenu() {
var itemElements = filterItems(inputElement.value, buildItems(options.items));
var componentPosition = componentElement.getBoundingClientRect();
+ var windowPosition = document.body.scrollTop || document.documentElement.scrollTop;
if (itemElements.length === 0) {
return null;
@@ -190,7 +191,7 @@ KB.component('select-dropdown-autocomplete', function(containerElement, options)
return KB.dom('ul')
.attr('id', 'select-dropdown-menu')
- .style('top', (document.body.scrollTop + componentPosition.bottom) + 'px')
+ .style('top', (windowPosition + componentPosition.bottom) + 'px')
.style('left', componentPosition.left + 'px')
.style('width', componentPosition.width + 'px')
.style('maxHeight', (window.innerHeight - componentPosition.bottom - 20) + 'px')