New Chat: Fix unresponsive button on Android
This commit is contained in:
parent
4808711e09
commit
fe5136634f
@ -27,29 +27,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.menu-is-open {
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: -13rem;
|
|
||||||
left: -11rem;
|
|
||||||
right: -1rem;
|
|
||||||
bottom: -1rem;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.is-touch-env & {
|
|
||||||
.Menu > .backdrop {
|
|
||||||
position: absolute;
|
|
||||||
left: -100vw;
|
|
||||||
right: -100vw;
|
|
||||||
top: -100vh;
|
|
||||||
bottom: -100vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .Button {
|
> .Button {
|
||||||
.icon-new-chat-filled,
|
.icon-new-chat-filled,
|
||||||
.icon-close {
|
.icon-close {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, useState, useEffect, memo,
|
FC, useState, useEffect, memo,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
@ -11,9 +11,6 @@ import MenuItem from '../ui/MenuItem';
|
|||||||
|
|
||||||
import './NewChatButton.scss';
|
import './NewChatButton.scss';
|
||||||
|
|
||||||
const MENU_CLOSE_DELAY_MS = 750;
|
|
||||||
let closeTimeout: number | undefined;
|
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
isShown: boolean;
|
isShown: boolean;
|
||||||
onNewPrivateChat: () => void;
|
onNewPrivateChat: () => void;
|
||||||
@ -51,30 +48,8 @@ const NewChatButton: FC<OwnProps> = ({
|
|||||||
setIsMenuOpen(false);
|
setIsMenuOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleMouseEnter = useCallback(() => {
|
|
||||||
if (closeTimeout) {
|
|
||||||
clearTimeout(closeTimeout);
|
|
||||||
closeTimeout = undefined;
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleMouseLeave = useCallback(() => {
|
|
||||||
if (closeTimeout) {
|
|
||||||
clearTimeout(closeTimeout);
|
|
||||||
closeTimeout = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
closeTimeout = window.setTimeout(() => {
|
|
||||||
setIsMenuOpen(false);
|
|
||||||
}, MENU_CLOSE_DELAY_MS);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div className={fabClassName}>
|
||||||
className={fabClassName}
|
|
||||||
onMouseEnter={handleMouseEnter}
|
|
||||||
onMouseLeave={handleMouseLeave}
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
round
|
round
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user