Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(calendar): info popover overlap #2268

Merged
merged 6 commits into from
Feb 8, 2025
Merged

Conversation

hillaliy
Copy link
Contributor

@hillaliy hillaliy commented Feb 7, 2025


Homarr

Thank you for your contribution. Please ensure that your pull request meets the following pull request:

  • Builds without warnings or errors (pnpm buid, autofix with pnpm format:fix)
  • Pull request targets dev branch
  • Commits follow the conventional commits guideline
  • No shorthand variable names are used (eg. x, y, i or any abbrevation)

@hillaliy hillaliy requested a review from a team as a code owner February 7, 2025 15:22
@hillaliy hillaliy self-assigned this Feb 7, 2025
@hillaliy hillaliy added the bug Something isn't working label Feb 7, 2025
Copy link

deepsource-io bot commented Feb 7, 2025

Here's the code health analysis summary for commits c04c42d..4654101. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@hillaliy hillaliy linked an issue Feb 7, 2025 that may be closed by this pull request
Copy link

github-actions bot commented Feb 7, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 21.56% 8693 / 40315
🔵 Statements 21.56% 8693 / 40315
🔵 Functions 26.8% 341 / 1272
🔵 Branches 62.45% 993 / 1590
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/widgets/src/calendar/calender-day.tsx 0% 0% 0% 0% 1-93
packages/widgets/src/calendar/component.tsx 0% 0% 0% 0% 1-130
Generated in workflow #4994 for commit 4654101 by the Vitest Coverage Report Action

@hillaliy hillaliy changed the title bug: Calendar widget overlap fix: Calendar widget overlap Feb 7, 2025
@hillaliy
Copy link
Contributor Author

hillaliy commented Feb 7, 2025

Sorry about Semantic Commits, my mistake

@Meierschlumpf
Copy link
Member

No problem 😉

@Meierschlumpf
Copy link
Member

Can you check why the popover does not close? Mantine states it should close by default:
https://mantine.dev/core/popover/#click-outside

I would guess that the problem is that we use onClose. Can you try out with onChange instead and instead of useDisclosure use useState? Then also don't add onClick in the container as it's already done through the target.

In the component.tsx you will also need to change the line:

return <CalendarDay date={tileDate} events={eventsForDate} disabled={isEditMode} />;

to

return <CalendarDay date={tileDate} events={eventsForDate} disabled={isEditMode || events.length === 0} />;

as we want to disable the popover when no event exists for the day

@hillaliy
Copy link
Contributor Author

hillaliy commented Feb 7, 2025

Can you check why the popover does not close? Mantine states it should close by default: https://mantine.dev/core/popover/#click-outside

I would guess that the problem is that we use onClose. Can you try out with onChange instead and instead of useDisclosure use useState? Then also don't add onClick in the container as it's already done through the target.

In the component.tsx you will also need to change the line:

return <CalendarDay date={tileDate} events={eventsForDate} disabled={isEditMode} />;

to

return <CalendarDay date={tileDate} events={eventsForDate} disabled={isEditMode || events.length === 0} />;

as we want to disable the popover when no event exists for the day

Popover don't work when removing onClick from container.

@hillaliy hillaliy closed this Feb 7, 2025
@hillaliy hillaliy reopened this Feb 7, 2025
packages/widgets/src/calendar/calender-day.tsx Outdated Show resolved Hide resolved
packages/widgets/src/calendar/calender-day.tsx Outdated Show resolved Hide resolved
@Meierschlumpf Meierschlumpf self-requested a review February 8, 2025 09:30
@Meierschlumpf Meierschlumpf changed the title fix: Calendar widget overlap fix(calendar): info popover overlap Feb 8, 2025
@Meierschlumpf Meierschlumpf merged commit 584c660 into dev Feb 8, 2025
13 of 14 checks passed
@Meierschlumpf Meierschlumpf deleted the calendar-widget-overlap branch February 8, 2025 09:37
@Meierschlumpf
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

bug: Calendar widget overlap
2 participants