Skip to content
Snippets Groups Projects
Unverified Commit 96964224 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:bug: fix budget tooltip showing if panel is not collapsed (#2887)

parent 0ed5e3eb
No related branches found
No related tags found
No related merge requests found
......@@ -200,6 +200,7 @@ export function BudgetSummary({ month }: BudgetSummaryProps) {
prevMonthName={prevMonthName}
month={month}
onBudgetAction={onBudgetAction}
isCollapsed
/>
</View>
) : (
......
......@@ -19,6 +19,7 @@ type ToBudgetProps = {
prevMonthName: string;
style?: CSSProperties;
amountStyle?: CSSProperties;
isCollapsed?: boolean;
};
export function ToBudget({
month,
......@@ -26,6 +27,7 @@ export function ToBudget({
onBudgetAction,
style,
amountStyle,
isCollapsed = false,
}: ToBudgetProps) {
const [menuOpen, setMenuOpen] = useState<string | null>(null);
const triggerRef = useRef(null);
......@@ -34,6 +36,7 @@ export function ToBudget({
value: 0,
});
const availableValue = parseInt(sheetValue);
const isMenuOpen = Boolean(menuOpen);
return (
<>
......@@ -43,13 +46,14 @@ export function ToBudget({
prevMonthName={prevMonthName}
style={style}
amountStyle={amountStyle}
isTotalsListTooltipDisabled={!isCollapsed || isMenuOpen}
/>
</View>
<Popover
triggerRef={triggerRef}
placement="bottom"
isOpen={!!menuOpen}
isOpen={isMenuOpen}
onOpenChange={() => setMenuOpen(null)}
style={{ width: 200 }}
>
......
......@@ -20,6 +20,7 @@ type ToBudgetAmountProps = {
style?: CSSProperties;
amountStyle?: CSSProperties;
onClick: () => void;
isTotalsListTooltipDisabled?: boolean;
};
export function ToBudgetAmount({
......@@ -27,6 +28,7 @@ export function ToBudgetAmount({
style,
amountStyle,
onClick,
isTotalsListTooltipDisabled = false,
}: ToBudgetAmountProps) {
const sheetName = useSheetName(rolloverBudget.toBudget);
const sheetValue = useSheetValue({
......@@ -52,7 +54,8 @@ export function ToBudgetAmount({
/>
}
placement="bottom"
triggerProps={{ delay: 0 }}
offset={3}
triggerProps={{ isDisabled: isTotalsListTooltipDisabled }}
>
<PrivacyFilter blurIntensity={7}>
<Block
......
---
category: Bugfix
authors: [MatissJanis]
---
Fix budget tooltip showing on hover if the panel is not collapsed (the tooltip should show only if panel is collapsed).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment