Esri / Esri/calcite-react

Search: cursor gets moved to end of entered text in search textbox after each new character

Open
#380 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
51
Forks
13
PR merge metrics
No merged PRs in 30d

Description

## Expected Behavior
Typing a search string will never jump to the end of the string

## Current Behavior
Type a search string, position the cursor anywhere in the existing search string, continue typing, after each keystroke the cursor will jump to the end of the search string

## Possible Solution
this happens most likely because the value is controlled and the user action updates state so that current value is out of sync with state and therefore control updates; not sure how to fix though

## Steps to Reproduce (for bugs)
Click in the search textbox and enter the text "hill".
Use the left key to move the cursor in the textbox to the beginning of the entered text, before the "h".
Enter text "amy "

## Context + Screenshots
Current behavior | Expected behavior
--- | ---
![incorrect](https://user-images.githubusercontent.com/782065/82717638-52e1c300-9c52-11ea-9e70-faa271c37690.png) | ![expected](https://user-images.githubusercontent.com/782065/82717640-570de080-9c52-11ea-9700-4aa756b75d78.png)

## Your Environment
Chrome on Windows

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.