Skip to content

Commit

Permalink
Fix keyboard navigation
Browse files Browse the repository at this point in the history
Refs: #6567
  • Loading branch information
anicyne committed Sep 10, 2024
1 parent 1d07334 commit e7c0e84
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class KolTableStateless implements TableStatelessAPI {
}
} else if (event.key === 'ArrowUp') {
event.preventDefault();
index = (index - 1) % this.checkboxRefs.length;
index = (index + this.checkboxRefs.length - 1) % this.checkboxRefs.length;
try {
await this.checkboxRefs[index].focus();
} catch (e) {
Expand Down Expand Up @@ -596,6 +596,7 @@ export class KolTableStateless implements TableStatelessAPI {

public render(): JSX.Element {
const dataField = this.createDataField(this.state._data, this.state._headerCells);
this.checkboxRefs = [];

return (
<Host class="kol-table-stateless-wc">
Expand Down

0 comments on commit e7c0e84

Please sign in to comment.