birdofpreyru/react-global-state

Debug global state interaction with inputs

Closed this issue · 1 comments

Say, this case:

const [st, setSt] = useGlobalState('path', { str: '' });
<input value={st.str} onChange={(e) => setSt({ ...st, str: e.target.value })} />

It looks like this will cause resets of the cursor to the input end after each key press. Presumably due to the delayed nature of the global state update notifications.

And this does not happen the global state value is a string rather than an object with string field. Thus, probably not the nature of updates, but something else affects it.

The issue seems to have regressed as of the latest v0.11.0.