Open Joeb3219 opened 3 years ago
@Joeb3219 as mentioned by @amcdnl in the issue you're referencing, the size is needed for virtual scroll functionality. This is a general problem not specific to ngx-datatable, see https://material.angular.io/cdk/scrolling/overview for example. If you want to open a feature request to discuss alternatives (maybe an option to disable virtual scrolling or something?) .
The way I managed to hack this with strict TS, is
<ngx-datatable-row-detail [rowHeight]="getHeight">
and
public getHeight(): any {
return '100%';
}
Angular HTML templates don't allow ignoring TS rules so it's not possible to build with 'auto'
there, but with 'any'
you can usually ignore the rules in ts files.
I'm submitting a ... (check one with "x")
Current behavior
The exported typings for the row-detail
rowHeight
property arenumber | (...) => number
, whereas it has been shown in this issue that'auto'
or'100%'
will actually work correctly. I have confirmed this locally -- I can use'auto'
as an option and everything works well.You can use
[rowHeight]="'auto'"
in non-strict TS mode on templates, but not when strict template checking is enabled, as'auto'
isn't a number.Expected behavior
The typings should reflect that
'auto'
is a valid value. I can make this change, but wanted to open a bug report first, as it didn't seem crystal clear that this was meant to be supported.Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment: Valid type checking, yielding no errors.
Ubuntu
16.0.3
11.0.2
FF/All