Closed camhom closed 2 months ago
If this is a duplicate of #355, I think the workaround is to apply a fixed height to your datagrid.
To clarify this is not a duplicate of #355. The input field that I've referring to is an input element which is outside of the datagrid component. This input uses (ngModelChange)
to trigger updates to the list of record rows being provided to the datagrid. i.e. A custom global filter input control.
Here's some chicken scratch code for clarification (for example purposes only, code logic may be incorrect):
example.component.html
<input clrInput
placeholder="Global Table Filter"
name="globalFilter"
[ngModel]="globalFilter$ | async"
(ngModelChange)="setGlobalFilter($event)">
<clr-datagrid (clrDgRefresh)="onRefresh($event)">
<clr-dg-column></clr-dg-column>
...
<clr-dg-row *clrDgItems="let row of rows || []">
...
</clr-dg-row>
...
</clr-datagrid>
example.component.ts
setGlobalFilter(value: string) {
// Do filter logic
this.rows = this._rows.filter(r => r === value)
}
Thanks for that! I have created a reproduction: https://stackblitz.com/edit/3lryrf?file=src%2Fapp%2Fexample.component.ts,src%2Fapp%2Fexample.component.html
I can confirm that this was introduced in v17.2.0.
It should still be the same root reason as in https://github.com/vmware-clarity/ng-clarity/issues/355 Any manipulation on the datagrid data, that triggers datagrid refresh would end the same.
Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.
Describe the bug
Unexpected focusing of the datagrid table cell header is occuring when using @clr/angular 17.2.1
How to reproduce
Expected behavior
Input element should still be in focus
Versions
Clarity version: "@cds/core": "6.13.0", "@clr/angular": "17.2.1", "@clr/ui": "17.2.1",
Framework version: Angular 17
Device:
Additional notes
The bug is not in 17.1.x, which indicates that it was either introduced in 17.2.0 or 17.2.1.