When typing in a scrollable TextBox, if the text reaches a point where it starts to scroll and the beginning letters are no longer visible, selecting all text (Ctrl + A) and replacing it with a single character causes a visual glitch. The new character appears clipped and seems as if it hasn’t been typed until the left arrow key is pressed to reveal its presence. This issue seems to stem from the cursor positioning in front of the new character, causing it to be clipped out on the left side of the TextBox.
A temporary workaround is setting the CursorPosition property of the TextBox to 0 and then back to 1 when the text length is 1, but this has other unintended side effects and is very buggy.
Steps to Reproduce:
- Type in a scrollable TextBox until the text begins to scroll and the initial characters are no longer visible.
- Press Ctrl + A to select all text.
- Replace the selected text with a single character (e.g., “A”).
- Observe that the new character appears clipped and seems as if it hasn’t been typed.
- Press the left arrow key to move the cursor and reveal the character.
This issue affects UX by making it appear as though text input has failed or the TextBox is malfunctioning. Addressing this bug will improve the usability of the new scrolling feature for TextBoxes:
Expected behavior:
The new character should be visible immediately after replacing the selected text without any visual clipping or needing to adjust the cursor position.
Actual Behavior:
The new character is visually clipped and appears as if it hasn’t been typed until the cursor is moved with the left arrow key.