mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 09:06:23 +01:00
Attempt to fix menu sometimes not closeable on Mobile Safari
This commit is contained in:
parent
393a473649
commit
59cf6b2a58
1 changed files with 8 additions and 1 deletions
|
@ -339,6 +339,7 @@ function Status({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const menuInstanceRef = useRef();
|
||||||
const StatusMenuItems = (
|
const StatusMenuItems = (
|
||||||
<>
|
<>
|
||||||
{!isSizeLarge && (
|
{!isSizeLarge && (
|
||||||
|
@ -559,22 +560,28 @@ function Status({
|
||||||
{size !== 'l' &&
|
{size !== 'l' &&
|
||||||
(url ? (
|
(url ? (
|
||||||
<Menu
|
<Menu
|
||||||
|
instanceRef={menuInstanceRef}
|
||||||
portal={{
|
portal={{
|
||||||
target:
|
target:
|
||||||
document.querySelector('.status-deck') || document.body,
|
document.querySelector('.status-deck') || document.body,
|
||||||
}}
|
}}
|
||||||
|
containerProps={{
|
||||||
|
onClick: () => {
|
||||||
|
menuInstanceRef.current?.closeMenu?.();
|
||||||
|
},
|
||||||
|
}}
|
||||||
align="end"
|
align="end"
|
||||||
offsetY={4}
|
offsetY={4}
|
||||||
overflow="auto"
|
overflow="auto"
|
||||||
viewScroll="close"
|
viewScroll="close"
|
||||||
boundingBoxPadding="8 8 8 8"
|
boundingBoxPadding="8 8 8 8"
|
||||||
|
unmountOnClose
|
||||||
menuButton={
|
menuButton={
|
||||||
<Link
|
<Link
|
||||||
to={instance ? `/${instance}/s/${id}` : `/s/${id}`}
|
to={instance ? `/${instance}/s/${id}` : `/s/${id}`}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
console.log('click', e);
|
|
||||||
}}
|
}}
|
||||||
class="time"
|
class="time"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue