Просмотр исходного кода

Fix dropdown's list position when page is scrolled

Fixes an issue where dropdown list would appear as if the page was not
scrolled, even though the page was.
Sergiu Miclea 8 лет назад
Родитель
Сommit
57319c9282
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/components/molecules/Dropdown/Dropdown.jsx

+ 1 - 1
src/components/molecules/Dropdown/Dropdown.jsx

@@ -158,7 +158,7 @@ class Dropdown extends React.Component {
       this.tipRef.style.display = 'block'
     }
 
-    this.listRef.style.top = `${listTop}px`
+    this.listRef.style.top = `${listTop + window.pageYOffset}px`
     this.listRef.style.left = `${this.buttonRect.left}px`
   }