Skip to content

wangtjwork/react_input_cursor_flash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project was bootstrapped with Create React App.

Purpose

A demonstration of unexpected lost input cursor position on input elements with asynchronous updates to their values.

Set up

In project directory, run yarn start or npm start.

Symptom

After a new browser window is open, type a string into the input field, and then move the cursor to the middle of the string. Any change on the string including backspace or type in new characters will result in the cursor being auto moved by react to be after the string, and if want to make multiple changes this is really unwanted behavior.

Learn More

To learn about how to fix the behavior and the root cause of the problem, check out my Medium post Bugs of Week 11/19/2018 - Jumping Cursor.

About

A Demo on React's strange behavior when using dispatch after setState.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published