|
event.index = this._inputField.cursorIndex; |
This line of code does not seem to be hit when index is set to 0 when there is existing text.
Steps:
- In an input, enter some text: "test|" (where '|' is cursor)
- Move cursor left 2 times: "te|st"
- Enter text 'a': "tea|st" - Note here that text enters correctly because the condition on line 202 sees cursorIndex as valid (ie 2)
However, if you move the cursor all the way to beginning: "|test"
The condition now fails because cursorIndex = 0 is falsey. So line 203 is skipped and defaults to this._input.length, which will add to end.
Lightning-ui/src/Keyboard.js
Line 203 in 011c938
This line of code does not seem to be hit when index is set to 0 when there is existing text.
Steps:
However, if you move the cursor all the way to beginning: "|test"
The condition now fails because
cursorIndex = 0is falsey. So line 203 is skipped and defaults tothis._input.length, which will add to end.