Skip to content

Commit cb70e57

Browse files
failing test to demonstrate issue with restoring focus on a numeric id.
1 parent 4772ef3 commit cb70e57

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/restore-focus.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,25 @@ describe("Option to forcibly restore focus after morph", function () {
651651
assertFocus("focused");
652652
});
653653

654+
it("restores focus state with reparented numeric id", function () {
655+
assertFocusPreservationWithoutMoveBefore(
656+
`
657+
<div>
658+
<input type="text" id="other">
659+
<div>
660+
<input type="text" id="1" value="abc">
661+
</div>
662+
</div>`,
663+
`
664+
<div>
665+
<input type="text" id="other">
666+
<input type="text" id="1" value="abc">
667+
</div>`,
668+
"1",
669+
"b",
670+
);
671+
});
672+
654673
it("preserves focus state when focused element is moved between anonymous containers", function () {
655674
assertFocusPreservationWithoutMoveBefore(
656675
`

0 commit comments

Comments
 (0)