-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
Minor
-
Load testing
-
M
Issue Summary:
When using the TextArea with the `onChange` and `value` attributes in a UI Kit Forge app in Jira, the cursor jumps when typing quickly in the text area.
Steps to Reproduce
- Add the code below to create a simple TextArea
- Set the cursor to the first position or to the middle of the dots
- Type some letters very quickly or press three or more keys at the same time
- You will see that the dots now appear between your new letters
You could remove the ‘value’ attribute to prevent the problem from occurring, but then you wouldn’t be able to edit the value from the script.
The problem shouldn't be too bad if you type at a normal speed, but the cursor always acts strangely when you've cleared a few lines with Enter and want to continue typing above them.
import React, { useState } from 'react'; import ForgeReconciler, { TextArea } from '@forge/react'; const App = () => { const [text, setText] = useState(".........."); return ( <> <TextArea onChange={event => setText(event.target.value)} value={text} /> </> ); }; ForgeReconciler.render( <React.StrictMode> <App /> </React.StrictMode> );
Workaround
potential workaround is to utilise _.throttle to smooth out or reduce fast inputs / render cycle.
- is blocked by
-
EXT-3806 Loading...