diff --git a/src/_common b/src/_common index 17d0a74f75..01a5dbe678 160000 --- a/src/_common +++ b/src/_common @@ -1 +1 @@ -Subproject commit 17d0a74f75281bb4abff81ed90184cc78c568aae +Subproject commit 01a5dbe6785dea1897f0298812c63a5c90dfe0c2 diff --git a/src/table/base-table.tsx b/src/table/base-table.tsx index 33818b3f79..a566be4b7b 100644 --- a/src/table/base-table.tsx +++ b/src/table/base-table.tsx @@ -176,6 +176,7 @@ export default defineComponent({ clearHoverRow, addRowHoverKeyboardListener, removeRowHoverKeyboardListener, + tableRefTabIndex, } = useHoverKeyboardEvent(props, tableRef); watch(tableElmRef, () => { @@ -394,6 +395,7 @@ export default defineComponent({ horizontalScrollAffixRef, headerTopAffixRef, footerBottomAffixRef, + tableRefTabIndex, }; }, @@ -714,7 +716,7 @@ export default defineComponent({ return (
(); const currentHoverRowIndex = ref(-1); + const tableRefTabIndex = ref(0); // 单行高亮场景,不需要键盘悬浮效果 const needKeyboardRowHover = computed(() => { @@ -67,6 +77,13 @@ export function useHoverKeyboardEvent(props: BaseTableProps, tableRef: Ref { @@ -83,6 +100,7 @@ export function useHoverKeyboardEvent(props: BaseTableProps, tableRef: Ref { const code = e.code || e.key?.trim(); + if (ARROW_DOWN_REG.test(code)) { e.preventDefault(); const index = Math.min(data.value.length - 1, currentOperationRowIndex.value + 1);