Skip to content

Commit 27aaaf4

Browse files
committed
fix(VDataTable): only tab focus sortable columns
fixes #20899
1 parent 5d81d46 commit 27aaaf4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/vuetify/src/components/VDataTable/VDataTableColumn.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const VDataTableColumn = defineFunctionalComponent({
2222
const Tag = props.tag ?? 'td'
2323
return (
2424
<Tag
25-
tabindex="0"
2625
class={[
2726
'v-data-table__td',
2827
{

packages/vuetify/src/components/VDataTable/VDataTableHeaders.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,14 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
164164
}}
165165
colspan={ column.colspan }
166166
rowspan={ column.rowspan }
167-
onClick={ column.sortable ? () => toggleSort(column) : undefined }
168167
fixed={ column.fixed }
169168
nowrap={ column.nowrap }
170169
lastFixed={ column.lastFixed }
171170
noPadding={ noPadding }
171+
tabindex={ column.sortable ? 0 : undefined }
172+
onClick={ column.sortable ? () => toggleSort(column) : undefined }
173+
onKeydown={ column.sortable ? (event: KeyboardEvent) => handleEnterKeyPress(event, column) : undefined }
172174
{ ...headerProps }
173-
onKeydown={ (event: KeyboardEvent) => column.sortable && handleEnterKeyPress(event, column) }
174175
>
175176
{{
176177
default: () => {

0 commit comments

Comments
 (0)