From f9e6f45f8cae65bbe617c9c6c897ab0fba42ccde Mon Sep 17 00:00:00 2001 From: UnderKoen Date: Sun, 3 Nov 2024 22:10:08 +0100 Subject: [PATCH 1/6] enhance: context menu budget page positioning fix: make popover non selectable --- .../src/components/budget/SidebarCategory.tsx | 16 +++++++-- .../src/components/budget/SidebarGroup.tsx | 16 +++++++-- .../envelope/EnvelopeBudgetComponents.tsx | 33 +++++++++++++++---- .../envelope/budgetsummary/ToBudget.tsx | 30 ++++++++++++----- .../src/components/common/Popover.tsx | 1 + 5 files changed, 78 insertions(+), 18 deletions(-) diff --git a/packages/desktop-client/src/components/budget/SidebarCategory.tsx b/packages/desktop-client/src/components/budget/SidebarCategory.tsx index 4d3b53e7a04..c125cedb71d 100644 --- a/packages/desktop-client/src/components/budget/SidebarCategory.tsx +++ b/packages/desktop-client/src/components/budget/SidebarCategory.tsx @@ -54,6 +54,9 @@ export function SidebarCategory({ const triggerRef = useRef(null); const contextMenusEnabled = useFeatureFlag('contextMenus'); + const [crossOffset, setCrossOffset] = useState(0); + const [offset, setOffset] = useState(0); + const displayed = (
setMenuOpen(true)} + onPress={() => { + setOffset(0); + setCrossOffset(0); + setMenuOpen(true); + }} > setMenuOpen(false)} - style={{ width: 200 }} + style={{ width: 200, margin: 1 }} isNonModal + offset={offset} + crossOffset={crossOffset} > { diff --git a/packages/desktop-client/src/components/budget/SidebarGroup.tsx b/packages/desktop-client/src/components/budget/SidebarGroup.tsx index 530c8f334a5..0c4b5823778 100644 --- a/packages/desktop-client/src/components/budget/SidebarGroup.tsx +++ b/packages/desktop-client/src/components/budget/SidebarGroup.tsx @@ -59,6 +59,9 @@ export function SidebarGroup({ const triggerRef = useRef(null); const contextMenusEnabled = useFeatureFlag('contextMenus'); + const [crossOffset, setCrossOffset] = useState(0); + const [offset, setOffset] = useState(0); + const displayed = ( {!dragPreview && ( @@ -108,7 +114,11 @@ export function SidebarGroup({