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: Not possible to select month and year in FluentDatePicker #2746

Closed
dionistakac88 opened this issue Oct 2, 2024 · 5 comments
Closed
Assignees

Comments

@dionistakac88
Copy link

dionistakac88 commented Oct 2, 2024

We would like to have FluentDatePicker and possibility to select day, month and year as it was the case in earlier version (for example 4.9.1).

Currently in version 4.10.0, there is no possibility to open month or year view in the same component. When we click on month/year, picker is closed.
It is possible to choose only month or only year view by defining 'View' property in separate components, but we need possibility to do that in the same component as it was the case before.

Steps to reproduce:

  1. Open FluentDatePicker with View property set to 'Day'
  2. Try to click on year/month

Expected:
Monthly and yearly picker is opened

Actual:
FluentDatePicker is closed.

Could you help with this? We got this issue after upgrading fluentui library from 4.9.1 to 4.10.0 version.

Thank you.

@microsoft-github-policy-service microsoft-github-policy-service bot added the triage New issue. Needs to be looked at label Oct 2, 2024
@pradm777
Copy link

pradm777 commented Oct 2, 2024

please provide above solution.

@dvoituron-msft
Copy link
Collaborator

Weird. Are you using Blazor Server or Blazor WebAssembly ?

@dvoituron-msft dvoituron-msft added status:needs-investigation Needs additional investigation and removed triage New issue. Needs to be looked at labels Oct 2, 2024
@dionistakac88
Copy link
Author

Weird. Are you using Blazor Server or Blazor WebAssembly ?

We use Blazor WebAssembly. Even if you check official doc and component "FluentDatePicker", you can reproduce the issue - https://www.fluentui-blazor.net/DateTime

@dvoituron
Copy link
Collaborator

Yes, I tested locally using WASM and the Server: Blazor Server works but not with Blazor WebAssembly.
I don't know why.
We will try to fix this as soon as possible.

@dvoituron dvoituron self-assigned this Oct 3, 2024
@dvoituron dvoituron removed the status:needs-investigation Needs additional investigation label Oct 3, 2024
@dvoituron
Copy link
Collaborator

This problem seems to be due to the current way of detecting when a user clicks in a FluentOverlay exclusion zone:

  • Currently, when the user clicks on an element, we calculate the isExcludeElement variable based on event.target.
    const isExcludeElement = excludeElement && excludeElement.contains(event.target);
    However, Blazor WASM refreshes HTML DOM faster than Blazor Server, making target invalid in this test.

  • We correct this problem by calculating isInsideExcludedElement using the coordinates of the mouse click.
    const isInsideExcludedElement = !!document.getElementById(id) && isClickInsideContainer(event, document.getElementById(id));

See #2755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants