From f9d60a267a7f3e5d5b9e4b03c6e9f8a61f0ad2f2 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 16 Apr 2025 09:02:28 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=87=BD=E6=95=B0=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.js b/src/BootstrapBlazor/Components/Table/Table.razor.js index 6be8c44c291..8490106d15f 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.js +++ b/src/BootstrapBlazor/Components/Table/Table.razor.js @@ -389,8 +389,12 @@ const setExcelKeyboardListener = table => { const setFocus = target => { const handler = setTimeout(function () { clearTimeout(handler); - target.focus(); - target.select(); + if (target.focus) { + target.focus(); + } + if (target.select) { + target.select(); + } }, 10); } From aa9fa54f5b1ceb8db3d910a7b8d1d0b561aa48bd Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 16 Apr 2025 09:02:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=90=9C=E7=B4=A2=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.js b/src/BootstrapBlazor/Components/Table/Table.razor.js index 8490106d15f..541257454e0 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.js +++ b/src/BootstrapBlazor/Components/Table/Table.razor.js @@ -401,7 +401,7 @@ const setExcelKeyboardListener = table => { const activeCell = (cells, index) => { let ret = false; const td = cells[index]; - const target = td.querySelector('input.form-control:not([readonly])'); + const target = td.querySelector('.form-control:not([readonly])'); if (target) { setFocus(target); ret = true; From ccb5e5a97f28341e731bf01fe75de32a138fc456 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 16 Apr 2025 09:02:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=AD=A3=E8=A1=8C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Table/Table.razor.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.js b/src/BootstrapBlazor/Components/Table/Table.razor.js index 541257454e0..0998ac3afe6 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.js +++ b/src/BootstrapBlazor/Components/Table/Table.razor.js @@ -429,22 +429,30 @@ const setExcelKeyboardListener = table => { } } else if (keyCode === KeyCodes.UP_ARROW) { - cells = tr.previousElementSibling && tr.previousElementSibling.children; - if (cells) { - while (index < cells.length) { + let nextRow = tr.previousElementSibling; + while (nextRow) { + cells = nextRow.children; + if (cells) { if (activeCell(cells, index)) { break; } + else { + nextRow = nextRow.previousElementSibling; + } } } } else if (keyCode === KeyCodes.DOWN_ARROW) { - cells = tr.nextElementSibling && tr.nextElementSibling.children; - if (cells) { - while (index < cells.length) { + let nextRow = tr.nextElementSibling; + while (nextRow) { + cells = nextRow.children; + if (cells) { if (activeCell(cells, index)) { break; } + else { + nextRow = nextRow.nextElementSibling; + } } } } From 922bec4988c84cb0f0f11838b0ac3da5e441b798 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 16 Apr 2025 09:05:19 +0800 Subject: [PATCH 4/4] chore: bump version 9.5.6 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index cbab8bfd3b0..638733349aa 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.5.6-beta05 + 9.5.6