Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix Default Value #1

Merged
merged 2 commits into from
Apr 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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