Skip to content

Commit 42d026f

Browse files
committed
fix(IpAddress): Fix the issue where pressing 'Backspace' would delete an extra character when switching to the previous cell.
1 parent 35548f4 commit 42d026f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/BootstrapBlazor/Components/IpAddress/IpAddress.razor.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ export function init(id) {
5454
else if (e.key === 'Backspace') {
5555
if (c.value.length <= 1) {
5656
c.value = "0"
57-
if (index === 0)
58-
e.preventDefault();
57+
e.preventDefault();
5958
const prevCell = selectCell(el, index - 1)
6059
prevCell.selectionStart = prevCell.value.length
6160
prevCell.selectionEnd = prevCell.value.length
@@ -72,7 +71,7 @@ export function init(id) {
7271
selectCell(el, index - 1)
7372
}
7473
else if (e.key === 'Delete' || e.key === 'Tab' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
75-
74+
//原逻辑不做修改
7675
}
7776
else {
7877
e.preventDefault()

0 commit comments

Comments
 (0)