File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/components/src/components/table-stateless Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ export class KolTableStatelessWc implements TableStatelessAPI {
8484 private fixedOffsets : number [ ] = [ ] ;
8585 private resizeDebounceTimeout ?: ReturnType < typeof setTimeout > ;
8686
87+ private settingsChangedCounter = 0 ;
88+
8789 @State ( )
8890 private tableDivElementHasScrollbar = false ;
8991
@@ -228,6 +230,7 @@ export class KolTableStatelessWc implements TableStatelessAPI {
228230 public handleSettingsChange ( event : CustomEvent < KoliBriTableHeaderCell [ ] [ ] > ) {
229231 const updatedHeaderCells = { ...this . state . _headerCells , horizontal : event . detail } ;
230232 setState ( this , '_headerCells' , updatedHeaderCells ) ;
233+ this . settingsChangedCounter ++ ;
231234
232235 // Call the onChangeHeaderCells callback if provided
233236 if ( typeof this . state . _on ?. [ Callback . onChangeHeaderCells ] === 'function' ) {
@@ -788,8 +791,8 @@ export class KolTableStatelessWc implements TableStatelessAPI {
788791
789792 return (
790793 < td
791- // nonce() is needed so every cell has a unique key after a state change and gets rerenderd
792- key = { `cell-${ key } -${ nonce ( ) } ` }
794+ // settingsChangedCounter is needed so every cell has a unique key after a settings change and gets rerenderd
795+ key = { `cell-${ key } -${ this . settingsChangedCounter } ` }
793796 class = { clsx (
794797 'kol-table__cell kol-table__cell--body' ,
795798 cell . textAlign && `kol-table__cell--align-${ cell . textAlign } ` ,
You can’t perform that action at this time.
0 commit comments