Text input scroll offset on blur

#41399375 Filed 2018-07-03 New / P4 / S5

Live sampler

Reproducer

Blur should not reset the text field's horizontal scroll position

Click in the input, move to the end of the text, then tab to the button. The visible text should stay near the caret position instead of jumping back to the beginning.

Before blurnot captured
After blurnot captured
Current scrollLeft0
Use the buttons or keyboard steps above.

Expected behavior

Pass condition

After the input loses focus, input.scrollLeft remains at the same non-zero position it had before blur. This keeps the end of a long value visible.

Minimal test case

const input = document.querySelector('input');
const button = document.querySelector('button');
input.focus();
input.scrollLeft = input.scrollWidth;
const before = input.scrollLeft;
button.focus();
assert_equals(input.scrollLeft, before);