mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-09-15 15:22:25 +03:00
Fixes the drag jitter on Android and only the grabber working after the virtual keyboard appears once
This commit is contained in:
parent
94eacffd99
commit
1e4fccb826
1 changed files with 12 additions and 2 deletions
|
@ -5,6 +5,14 @@ import './MobileContextMenu.scss';
|
|||
|
||||
export function MobileContextMenu({ isOpen, onClose, children }) {
|
||||
const { innerHeight } = window;
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
document.body.style.overscrollBehavior = 'contain';
|
||||
}
|
||||
return () => {
|
||||
document.body.style.overscrollBehavior = 'auto';
|
||||
};
|
||||
}, [isOpen]);
|
||||
|
||||
const [{ y }, api] = useSpring(() => ({
|
||||
y: innerHeight,
|
||||
|
@ -49,11 +57,13 @@ export function MobileContextMenu({ isOpen, onClose, children }) {
|
|||
{...bind()}
|
||||
style={{
|
||||
y,
|
||||
touchAction: 'pan-y',
|
||||
touchAction: 'none',
|
||||
}}
|
||||
>
|
||||
<div className="bottom-sheet-grabber" />
|
||||
<div className="bottom-sheet-content">{children}</div>
|
||||
<div className="bottom-sheet-content" style={{ overflow: 'visible' }}>
|
||||
{children}
|
||||
</div>
|
||||
</animated.div>
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue