Skip to content

Cannot insert text at beginning of text input when there is text #76

@aaronmensemble

Description

@aaronmensemble

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:

  1. In an input, enter some text: "test|" (where '|' is cursor)
  2. Move cursor left 2 times: "te|st"
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions