Skip to content

Commit bff600e

Browse files
committed
Removed autohiding
1 parent 9b5d68c commit bff600e

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.8.12 - 11 Nov 2021
2+
- Removed autohide on scroll because it had some problems with detecting scrollable parents
3+
14
## v0.8.11 - 4 Nov 2021
25
- Removed preventing form from submitting behaviour
36

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rmr/use-dropdown",
3-
"version": "0.8.11",
3+
"version": "0.8.12",
44
"description": "",
55
"main": "./lib/index.js",
66
"repository": {

src/useDropdown.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {ReducerAction} from './types/ReducerAction';
66
import {mergeReducers} from './utils/mergeReducers';
77
import {useEvent} from './useEvent';
88
import {findScrollContainers} from './utils/findScrollContainers';
9-
import {isElementInvisible} from './utils/isElementInvisible';
109

1110
type MenuWidth = Pick<CSSStyleDeclaration, 'width'> | 'wrapper';
1211

@@ -163,15 +162,6 @@ export const useDropdown = <TItem>(props: UseDropdownOptions<TItem>) => {
163162
}, [wrapperRef, menuRef.current]);
164163

165164
const setPosition = useCallback(() => {
166-
if (wrapperRef.current) {
167-
const parents = findScrollContainers(wrapperRef.current);
168-
const isInvisible = isElementInvisible(wrapperRef.current, parents);
169-
170-
if (isInvisible) {
171-
setOpen(false);
172-
}
173-
}
174-
175165
if (menuRef.current) {
176166
const {top, left, transform} = getPosition();
177167

@@ -180,7 +170,7 @@ export const useDropdown = <TItem>(props: UseDropdownOptions<TItem>) => {
180170
menuRef.current.style.transform = transform;
181171
menuRef.current.style.visibility = 'visible';
182172
}
183-
}, [parents]);
173+
}, []);
184174

185175
const handleKeyDown = useCallback((ev: KeyboardEvent) => {
186176
switch (ev.key) {

0 commit comments

Comments
 (0)