Переглянути джерело

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 роки тому
батько
коміт
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.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`
     this.listRef.style.left = `${this.buttonRect.left}px`
   }
   }