This test checks if setSelectionRange(), selectionStart, and selectionEnd on a textarea and input work as expected. This includes checking edge cases such as out-of-bound values. | |
If this test passed you'll see a bunch of correct selection ranges below. Check the expected file for the correct ranges. | |
===textarea=== | |
setSelectionRange(): | |
3, 7 | |
0, 5 | |
42, 48 | |
2, 2 | |
selectionStart: | |
3, 3 | |
7, 7 | |
0, 7 | |
48, 48 | |
3, 48 | |
selectionEnd: | |
3, 5 | |
2, 2 | |
0, 0 | |
0, 48 | |
7, 7 | |
===input=== | |
setSelectionRange(): | |
3, 7 | |
0, 5 | |
42, 48 | |
2, 2 | |
selectionStart: | |
3, 3 | |
7, 7 | |
0, 7 | |
48, 48 | |
3, 48 | |
selectionEnd: | |
3, 5 | |
2, 2 | |
0, 0 | |
0, 48 | |
7, 7 | |