mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 20:28:52 +03: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}
|
||||
onContextMenu={(e) => {
|
||||
if (size === 'l') return;
|
||||
if (e.metaKey) return;
|
||||
e.preventDefault();
|
||||
setContextMenuAnchorPoint({
|
||||
|
@ -515,20 +516,28 @@ function Status({
|
|||
setIsContextMenuOpen(true);
|
||||
}}
|
||||
>
|
||||
<ControlledMenu
|
||||
state={isContextMenuOpen ? 'open' : 'closed'}
|
||||
anchorPoint={contextMenuAnchorPoint}
|
||||
direction="right"
|
||||
onClose={() => setIsContextMenuOpen(false)}
|
||||
portal={{
|
||||
target: document.body,
|
||||
}}
|
||||
overflow="auto"
|
||||
boundingBoxPadding="8 8 8 8"
|
||||
unmountOnClose
|
||||
>
|
||||
{StatusMenuItems}
|
||||
</ControlledMenu>
|
||||
{size !== 'l' && (
|
||||
<ControlledMenu
|
||||
state={isContextMenuOpen ? 'open' : undefined}
|
||||
anchorPoint={contextMenuAnchorPoint}
|
||||
direction="right"
|
||||
onClose={() => setIsContextMenuOpen(false)}
|
||||
portal={{
|
||||
target: document.body,
|
||||
}}
|
||||
containerProps={{
|
||||
style: {
|
||||
// Higher than the backdrop
|
||||
zIndex: 1001,
|
||||
},
|
||||
}}
|
||||
overflow="auto"
|
||||
boundingBoxPadding="8 8 8 8"
|
||||
unmountOnClose
|
||||
>
|
||||
{StatusMenuItems}
|
||||
</ControlledMenu>
|
||||
)}
|
||||
{size !== 'l' && (
|
||||
<div class="status-badge">
|
||||
{reblogged && <Icon class="reblog" icon="rocket" size="s" />}
|
||||
|
|
Loading…
Reference in a new issue