Prechádzať zdrojové kódy

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 rokov pred
rodič
commit
57319c9282

+ 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`
   }