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

CalendarDatePicker does not support light dismiss in simple theme #18066

Closed
tvass83 opened this issue Jan 28, 2025 · 1 comment · Fixed by #18092
Closed

CalendarDatePicker does not support light dismiss in simple theme #18066

tvass83 opened this issue Jan 28, 2025 · 1 comment · Fixed by #18092
Labels
bug help-wanted A contribution from the community would be most welcome.

Comments

@tvass83
Copy link

tvass83 commented Jan 28, 2025

Describe the bug

By default, CalendarDatePicker's dropdown won't close when clicking outside its bounds when using Avalonia's simple theme.

I believe this is a regression between 0.10.22 vs 11.x, introduced here:
00c0823#diff-0511907109f114545e18d756f0b26d60d7785744ae6cd1e952eee4ec8f2249c5L121-R121

Simple theme style:

<Popup Name="PART_Popup"
PlacementTarget="{TemplateBinding}"
IsLightDismissEnabled="False">

Fluent theme style is correct:

<Popup Name="PART_Popup"
PlacementTarget="{TemplateBinding}"
IsLightDismissEnabled="True">

Workaround:
Override the default control template or use a style trigger to override the underlying Popup's IsLightDismissEnabled property.

To Reproduce

  1. Use simple theme
  2. Open dropdown of CalendarDatePicker
  3. Try to close the dropdown by clicking outside its visual bounds

Expected behavior

The dropdown shall be closed when clicking outside its visual bounds

Avalonia version

11.2.3

OS

No response

Additional context

No response

@tvass83 tvass83 added the bug label Jan 28, 2025
@MrJul
Copy link
Member

MrJul commented Jan 28, 2025

Yes, this sounds like a mistake introduced when StaysOpen was removed, the boolean needed to be reversed.
A PR would be welcome :)

@MrJul MrJul added the help-wanted A contribution from the community would be most welcome. label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help-wanted A contribution from the community would be most welcome.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants