mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
Update SelectBox.js
This commit is contained in:
parent
863a9823f1
commit
e1eea3de89
1 changed files with 2 additions and 4 deletions
|
@ -40,13 +40,11 @@ export function SelectBox({ options, selectedItem, setSelectedItem }) {
|
|||
useEffect(() => {
|
||||
// add when mounted
|
||||
document.addEventListener("mousedown", handleClick);
|
||||
//document.addEventListener("scroll", closeDropdown);
|
||||
// return function to be called when unmounted
|
||||
return () => {
|
||||
document.removeEventListener("mousedown", handleClick);
|
||||
document.removeEventListener("scroll", closeDropdown)
|
||||
};
|
||||
}, []);
|
||||
}, [handleClick]);
|
||||
|
||||
const onOptionClick = (e, option, i) => {
|
||||
e.stopPropagation()
|
||||
|
@ -68,4 +66,4 @@ export function SelectBox({ options, selectedItem, setSelectedItem }) {
|
|||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue