fix: Clicking content in the DataGrid's empty content throws an exception
joriverm opened this issue Β· comments
π Bug Report
when adding an interactive component inside the empty row content, and clicking it webcomponents will throw an error saying it can't find the row because the empty row does not contain an id.
π» Repro or Code Sample
in the example code i replaced the Intermittent loading example of the datagrid to have a button in its content when empty :
<div style="height: 400px; overflow-y: scroll;">
<FluentDataGrid @ref="grid" Items=@items GridTemplateColumns="1fr 1fr 1fr 1fr" Style="height: 100%;">
<ChildContent>
<PropertyColumn Property="@(c => c.Item1)" Sortable="true" />
<PropertyColumn Property="@(c => c.Item2)" />
<PropertyColumn Property="@(c => c.Item3)" Align="Align.Center" />
<PropertyColumn Property="@(c => c.Item4)" Align="Align.End" />
</ChildContent>
<EmptyContent>
<FluentButton IconStart="@(new Icons.Filled.Size24.Crown())"> Nothing to see here. Carry on!</FluentButton>
</EmptyContent>
</FluentDataGrid>
</div>
π€ Expected Behavior
nothing to happen besides the button click
π― Current Behavior
the click event happens, but webcomponents throws an error :
π Possible Solution
giving the empty-content-row an id prevents the webcomponents from throwing an exception. PR is incoming
π¦ Context
the issue has no effect on our code, but it shouldn't throw an error imo. this just fixes it so we don't think anything is wrong in our client code :)
π Your Environment
- OS & Device: Windows 10 / PC
- Browser: Mozilla FireFox
- .NET and Fluent UI Blazor library Version: 4.7.1