@@ -14,6 +14,7 @@ import {
14
14
css ,
15
15
defineElementEvent ,
16
16
html ,
17
+ keyed ,
17
18
listen ,
18
19
nothing ,
19
20
onResize ,
@@ -379,11 +380,9 @@ export const ToniqListTable = defineToniqElement<ListTableInputs>()({
379
380
function tableUpdate ( ) {
380
381
const container = host . shadowRoot . querySelector ( '.table-list' ) as HTMLElement ;
381
382
if ( container instanceof HTMLElement ) {
382
- requestAnimationFrame ( ( ) => {
383
- updateState ( {
384
- canScroll : container . scrollWidth > container . clientWidth ,
385
- tableListLeft : container . getBoundingClientRect ( ) . left ,
386
- } ) ;
383
+ updateState ( {
384
+ canScroll : container . scrollWidth > container . clientWidth ,
385
+ tableListLeft : container . getBoundingClientRect ( ) . left ,
387
386
} ) ;
388
387
}
389
388
}
@@ -545,7 +544,9 @@ export const ToniqListTable = defineToniqElement<ListTableInputs>()({
545
544
updateRowItems ( ) ;
546
545
} ) }
547
546
${ listen ( 'scroll' , ( ) => {
548
- tableUpdate ( ) ;
547
+ requestAnimationFrame ( ( ) => {
548
+ tableUpdate ( ) ;
549
+ } ) ;
549
550
} ) }
550
551
${ listen ( 'keydown' , ( event ) => {
551
552
if ( inputs . showLoading ) {
@@ -554,12 +555,15 @@ export const ToniqListTable = defineToniqElement<ListTableInputs>()({
554
555
}
555
556
} ) }
556
557
>
557
- ${ repeat (
558
- rows ,
559
- ( item ) => item ,
560
- ( item : ListTableRow < any > , index : number ) => {
561
- return listItem ( item , index ) ;
562
- } ,
558
+ ${ keyed (
559
+ state . rowStyles ,
560
+ repeat (
561
+ rows ,
562
+ ( item ) => item ,
563
+ ( item : ListTableRow < any > , index : number ) => {
564
+ return listItem ( item , index ) ;
565
+ } ,
566
+ ) ,
563
567
) }
564
568
${ renderIf (
565
569
state . canScroll ,
0 commit comments