TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
24.49k stars 3.03k forks source link

fix(angular-table): View is not updated anymore when flexRenderDirective is instantiated the first time with an empty value #5626

Closed riccardoperra closed 6 days ago

riccardoperra commented 1 week ago

While using Angular table adapter in our application, we discovered an issue with FlexRenderDirective that prevents the content from being shown if the cell renders a null | undefined value the first time.

Use case:

The issue is related to the current rendering mechanism, which is invoked inside the ngOnInit hook (one-time, only after Angular initialized all the inputs).

I moved the logic inside ngOnChanges, so that everything is invoked whenever the inputs change. I had to update some test according to this fix, so I moved the first two check about null | undefined in order to be sure that the content is reactive and always rendered (except for null | undefined)

Since we are using ngOnChanges, we don't need anymore to call the markForCheck while rendering a Component or TemplateRef inside the ngDoCheck

nx-cloud[bot] commented 1 week ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit f03fd09e610e69afb7cc0904ea5379d620fd05bd. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target - [`nx affected --targets=test:format,test:sherif,test:knip,test:lib,test:types,build --parallel=3`](https://cloud.nx.app/runs/fXRH5pSHXw?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.