Skip to content

Commit

Permalink
Merge pull request #1 from anastely/fixDefaultIndex
Browse files Browse the repository at this point in the history
refactor: Fix Default Value
  • Loading branch information
AdelRedaa97 committed Apr 9, 2021
2 parents f35b76a + afb1c9d commit 29382d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SelectDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const SelectDropdown = ({
rowStyle /* object */ /* style object for row */,
rowTextStyle /* object */ /* style object for row text */,
renderCustomizedRowChild /* function */ /* callback function recieves item and its index, this function should return React component as a child for customized row */,
isReset, // boolean, to call reset() when it true
}) => {
///////////////////////////////////////////////////////
const DropdownButton = useRef(); // button ref to get positions
Expand Down Expand Up @@ -157,6 +158,9 @@ const SelectDropdown = ({
setDropdownHEIGHT(150);
}
}, [dropdownStyle]);
useEffect(() => {
isReset && reset();
}, [isReset]);
///////////////////////////////////////////////////////
/* ******************** Methods ******************** */
const openDropdown = () => {
Expand Down

0 comments on commit 29382d5

Please sign in to comment.