BFUDetailsListAuto Failed to construct 'IntersectionObserver': The provided value is not of type '(Element or Document)'
See original GitHub issueI am working in a Blazor ClientSide .Net 5.0 project where I want to add a BFUDetailsListAuto component into my page. I followed the example shown (https://www.blazorfluentui.net/detailsListAutoPage) but after running my code I get the following error message:
Unhandled exception rendering component: Failed to construct ‘IntersectionObserver’: The provided value is not of type ‘(Element or Document)’
I have modified the DataItem class slightly:
public class DataItem
{
public DataItem()
{
}
public DataItem(int num)
{
Key = num.ToString();
KeyNumber = num;
DisplayName = "temp" + Key;
Description = "temp description" + Key;
}
public DataItem(string display, string key)
{
DisplayName = display;
Key = key;
}
public DataItem(string text, SelectableOptionMenuItemType selectableOptionMenuItemType)
{
DisplayName = text;
Type = selectableOptionMenuItemType;
}
public string Key { get; set; }
public int KeyNumber { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public SelectableOptionMenuItemType Type { get; set; }
}
My DetailsList looks like this:
<BFUDetailsListAuto ItemsSource="dataSource"
Columns="columnsSource"
GetKey=@(x=>x.Key)
LayoutMode="DetailsListLayoutMode.Justified"
Selection="selection"
SelectionMode="SelectionMode.Multiple"
/>
@code {
Selection<DataItem> selection = new Selection<DataItem>();
List<BFUDetailsRowColumn<DataItem>> columnsSource = new List<BFUDetailsRowColumn<DataItem>>();
List<DataItem> dataSource = new List<DataItem>();
protected override async Task OnInitializedAsync()
{
columnsSource.Add(new BFUDetailsRowColumn<DataItem, int>("Key", x => x.KeyNumber) {MinWidth=20, MaxWidth = 70, Index = 0, IsResizable = true });
columnsSource.Add(new BFUDetailsRowColumn<DataItem, string>("Name", x => x.DisplayName) { Index = 1, MinWidth = 100, MaxWidth = 150, IsResizable = true });
BFUDetailsRowColumn<DataItem, string> descriptionColumn = new BFUDetailsRowColumn<DataItem, string>("Description", x => x.Description) { Index = 2 };
columnsSource.Add(descriptionColumn);
int count = 0;
for (var i = 0; i < 100; i++)
{
count++;
dataSource.Add(new DataItem(count));
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Failed to construct 'IntersectionObserver': member root is ...
What is happening? Uncaught TypeError: Failed to construct 'IntersectionObserver': member root is not of type Element. at LazyLoad.
Read more >Failed to execute 'observe' on 'IntersectionObserver' ...
The element returns as null because the script runs before the HTML is parsed. I used defer in my script tag to avoid...
Read more >Experience Builder: Failed to construct 'IntersectionObserver'
When I try to open the URL a page comes out with: Failed to construct 'IntersectionObserver': member root is not of type Element....
Read more >[Typescript and React] Please help me with this Error with ...
I am trying to use a reference to a html element with IntersectionObserver, but I get an Error 'Uncaught TypeError: Failed to execute ......
Read more >IntersectionObserver: root property - Web APIs - MDN Web Docs
The IntersectionObserver interface's read-only root property identifies the Element or Document whose bounds are treated as the bounding box ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it’s something with DetailsListAuto component itself because I have the error too and I’ve managed to reproduce it in Demo project.
Copied Description column definition from DetailsListPageBasic.razor to DetailsListAutoPage.razor (and commented original definition) and the error is reproduced.
V5.2.5 has been pushed to NuGet