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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluentNumberField not working in WASM #87

Closed
chigivigi opened this issue Oct 12, 2021 · 11 comments
Closed

FluentNumberField not working in WASM #87

chigivigi opened this issue Oct 12, 2021 · 11 comments
Labels
area:fast A FAST-specific issue bug A bug community:request Issues specifically reported by a member of the community. status:in-progress Work is in progress

Comments

@chigivigi
Copy link

馃悰 Bug Report

I have a wasm project where I am testing fast-blazor components. The page breaks when containing FluentNumberField component.

馃捇 Repro or Code Sample

I have copied the code from the data grid example

<h2>Grid with RowItemTemplate</h2>
<Microsoft.Fast.Components.FluentUI.FluentDataGrid id="defaultGrid3" RowsData=RowsGrid1 ColumnDefinitions=ColumnsGrid1 GridTemplateColumns="1fr 1fr">
    <RowItemTemplate>
        <Microsoft.Fast.Components.FluentUI.FluentDataGridRow TItem=SampleGrid1Data>
            <Microsoft.Fast.Components.FluentUI.FluentDataGridCell GridColumn=1>
                <Microsoft.Fast.Components.FluentUI.FluentTextField @bind-Value=@context.Name></Microsoft.Fast.Components.FluentUI.FluentTextField>
            </Microsoft.Fast.Components.FluentUI.FluentDataGridCell>
             <Microsoft.Fast.Components.FluentUI.FluentDataGridCell GridColumn=2>
                <Microsoft.Fast.Components.FluentUI.FluentNumberField @bind-Value=@context.Age></Microsoft.Fast.Components.FluentUI.FluentNumberField>
            </Microsoft.Fast.Components.FluentUI.FluentDataGridCell>           

        </Microsoft.Fast.Components.FluentUI.FluentDataGridRow>
    </RowItemTemplate>
</Microsoft.Fast.Components.FluentUI.FluentDataGrid>

馃 Expected Behavior

I should be able to display the value and change it.

馃槸 Current Behavior

The column is not showing,
It breaks with the error message: crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: no idea on how to unbox value types
Error: no idea on how to unbox value types

馃拋 Possible Solution

I do not have a suggestion how to fix it.

馃敠 Context

We are testing this nuget package with the intention to change our frontend application to use it.

馃實 Your Environment

I am working on Windows 10 PC.
The browser I am using is Microsoft Edge Version 94.0.992.38.
The nuget package version I am using is 0.4.0.
The project is net5.0 blazor Wasm.

@dominicusmento
Copy link

It happens to me also, without the grid in client only blazor:
<FluentNumberField @bind-Value=@testNumber></FluentNumberField>

@vnbaaij
Copy link
Collaborator

vnbaaij commented Oct 12, 2021

I think this has to do with an issue in the underlying fast repo microsoft/fast#5246

ps. good to see you here guys!

@EisenbergEffect
Copy link
Contributor

Looks like we've got a fix under review for this in the main repo: microsoft/fast#5289

@EisenbergEffect EisenbergEffect added area:fast A FAST-specific issue bug A bug community:request Issues specifically reported by a member of the community. status:in-progress Work is in progress labels Oct 20, 2021
@EisenbergEffect
Copy link
Contributor

Closing this issue out now that the core component fix is in.

@chigivigi
Copy link
Author

@EisenbergEffect I cannot update Microsoft.Fast.Components.FluentUI nuget package, the last version is still 0.4.0

Could you provide a prerelease package if a new version is still not possible ?

@EisenbergEffect
Copy link
Contributor

This fix is dependent on the script rather than the Nuget package. What version of the script are you using?

@chigivigi
Copy link
Author

@EisenbergEffect I am working in a new Blazor WebAssembly project, there are no scripts. I am using the nugget package Microsoft.Fast.Components.FluentUI and nothing else in the project.

@vnbaaij
Copy link
Collaborator

vnbaaij commented Oct 28, 2021

@chigivigi If you follow the getting started in the readme (https://github.com/microsoft/fast-blazor#getting-started) for the project, you should have added a <script type="module" src="https://unpkg.com/@fluentui/web-components"></script> to your index.html or layout. That is the script @EisenbergEffect is refering to.
This script recently got updated to version 2.0 (which contains the visual refresh and the first set of fixes for the underlying <fluent-number-field>). There will be another update soon to fix the remaining number field issue (microsoft/fast#5315)

@chigivigi
Copy link
Author

@vnbaaij I put the script inside the index.html file and after starting it again I get the following error message:

image

The page breaks and the second column that should display the number field componente is empty:

image

@vnbaaij
Copy link
Collaborator

vnbaaij commented Oct 28, 2021

Ok, that is not good...I have a Web Assembly demo running in my fork (https://github.com/vnbaaij/fast-blazor/tree/new-demo) where this is working. You can see a working demo at https://thankful-island-0494bc003.azurestaticapps.net/DatagridPage.
I think it will be fixed once we release a new version of the package. If you need a working situation right now, your only option is to include the Microsoft.Fast.Components.FluentUI project in your solution. Beware though that as of now we are targeting .NET 6 (rc2).

@chigivigi
Copy link
Author

Alright, I will wait for the nugget package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast A FAST-specific issue bug A bug community:request Issues specifically reported by a member of the community. status:in-progress Work is in progress
Projects
None yet
Development

No branches or pull requests

4 participants