-
Notifications
You must be signed in to change notification settings - Fork 377
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: FluentTreeView events not called for Windows Forms, BlazorWebView component #633
Comments
Attached a minimal test-case for Windows Forms, WPF, Maui and Blazor Server. All projects are using the same RCL. FluentTreeView events are called in the Blazor Server project only. The FluentButton OnClick event is called is all projects. |
I cloned the repo and see that OnSelectedChange and OnExpandedChange are initialized when the component is first rendered, however, no events on the FluentTreeView are called after the initial render (added private fields for testing). Replaced FluentTreeView with the web component and the same behavior. Am I missing some javascript?
|
Hi Roland, Let me try to explain what is happening. Some web components (such as the fluent-tree-view) generate custom JavaScript events when user interaction with the component takes place. These events are 'captured' on the Blazor side and become available on the Blazor components in the form of the The issue is that when using the WebView the library's script does not get called so the I have not had time yet to find out if/how the initialization can be done when the WebView is being used. |
On the web-components script file... Starting with version 2.4.2, we added a version part to the (automatically loaded) web components script. So it will show up, in DevTools for example In v3 we will also add this version part to the script BUT that has not been done yet for the RC1 version/package. Any newer versions will have the version appended. Hope this clears up some confusion.., |
Thank you for explaining what's happening , Vincent. I really appreciate it. Given that this is not specific to FluentUI, should an issue be logged with the Blazor team to investigate further? Also, thank you for the clarification on the web components script file. |
I've already reached out internally but guess it would make sense to log an issue in the ASP.NET Core repo. Would be great if you can do that. |
Wait, I suddenly remembered we already ran into this with MAUI and, more importantly, we have a workaround!! See #404 |
Closing this as using the workaround as described in #404 works. Confirmed it on your minimal test case included earlier |
Thank you very much Vincent! Confirmed the workaround works in my environment as well. |
🐛 Bug Report
No FluentTreeview events called when using Windows Forms project with BlazorWebView hosting razor component from RCL
💻 Repro or Code Sample
Manually downloaded web-components-v2.5.16.min.js but that did not resolve the issue.
The OnClick event for the FluentButton works in this environment.
I'm very new to Blazor and FluentUI so maybe I'm missing something.
<PackageReference Include="Microsoft.Fast.Components.FluentUI" Version="3.0.0-RC.1" />
🤔 Expected Behavior
😯 Current Behavior
💁 Possible Solution
🔦 Context
🌍 Your Environment
The text was updated successfully, but these errors were encountered: