mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-09 01:26:24 +01:00
Fix context menu bugs
- It got mounted initially, need to set state to undefinde - Missing zIndex - Context menu got disabled on large status
This commit is contained in:
parent
4d59e5a804
commit
d0953a321a
1 changed files with 23 additions and 14 deletions
|
@ -506,6 +506,7 @@ function Status({
|
||||||
}`}
|
}`}
|
||||||
onMouseEnter={debugHover}
|
onMouseEnter={debugHover}
|
||||||
onContextMenu={(e) => {
|
onContextMenu={(e) => {
|
||||||
|
if (size === 'l') return;
|
||||||
if (e.metaKey) return;
|
if (e.metaKey) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setContextMenuAnchorPoint({
|
setContextMenuAnchorPoint({
|
||||||
|
@ -515,20 +516,28 @@ function Status({
|
||||||
setIsContextMenuOpen(true);
|
setIsContextMenuOpen(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{size !== 'l' && (
|
||||||
<ControlledMenu
|
<ControlledMenu
|
||||||
state={isContextMenuOpen ? 'open' : 'closed'}
|
state={isContextMenuOpen ? 'open' : undefined}
|
||||||
anchorPoint={contextMenuAnchorPoint}
|
anchorPoint={contextMenuAnchorPoint}
|
||||||
direction="right"
|
direction="right"
|
||||||
onClose={() => setIsContextMenuOpen(false)}
|
onClose={() => setIsContextMenuOpen(false)}
|
||||||
portal={{
|
portal={{
|
||||||
target: document.body,
|
target: document.body,
|
||||||
}}
|
}}
|
||||||
|
containerProps={{
|
||||||
|
style: {
|
||||||
|
// Higher than the backdrop
|
||||||
|
zIndex: 1001,
|
||||||
|
},
|
||||||
|
}}
|
||||||
overflow="auto"
|
overflow="auto"
|
||||||
boundingBoxPadding="8 8 8 8"
|
boundingBoxPadding="8 8 8 8"
|
||||||
unmountOnClose
|
unmountOnClose
|
||||||
>
|
>
|
||||||
{StatusMenuItems}
|
{StatusMenuItems}
|
||||||
</ControlledMenu>
|
</ControlledMenu>
|
||||||
|
)}
|
||||||
{size !== 'l' && (
|
{size !== 'l' && (
|
||||||
<div class="status-badge">
|
<div class="status-badge">
|
||||||
{reblogged && <Icon class="reblog" icon="rocket" size="s" />}
|
{reblogged && <Icon class="reblog" icon="rocket" size="s" />}
|
||||||
|
|
Loading…
Reference in a new issue