Sfoglia il codice sorgente

Fix issue with dropdown list position

This fixes the case where a dropdown is opened while its button is
scrolled out of its original position.
Sergiu Miclea 8 anni fa
parent
commit
d8e578bdac
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      src/components/molecules/Dropdown/Dropdown.jsx

+ 4 - 0
src/components/molecules/Dropdown/Dropdown.jsx

@@ -119,6 +119,10 @@ class Dropdown extends React.Component {
     this.buttonRect = this.buttonRef.getBoundingClientRect()
     this.buttonRect = this.buttonRef.getBoundingClientRect()
   }
   }
 
 
+  componentWillUpdate() {
+    this.buttonRect = this.buttonRef.getBoundingClientRect()
+  }
+
   componentDidUpdate() {
   componentDidUpdate() {
     this.updateListPosition()
     this.updateListPosition()
   }
   }