Ver código fonte

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 anos atrás
pai
commit
57319c9282
1 arquivos alterados com 1 adições e 1 exclusões
  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`
   }