Observed behaviour:
I noticed unexpected cursor behavior while implementing Mentions in a larger application. When text is cut (cmd+x) from the MentionsInput, the cursor jumps to the end of the text area when the cut action is performed. Forcing the user to manually put the cursor into the place they want to type.
Expected behaviour:
The cursor should remain in place when text is cut from the MentionsInput element.
Workaround:
Users have to copy and delete rather than cut in order to keep the cursor in place.
Steps to reproduce:
I created a small, separate react app to check if the cursor behavior was caused by my application or react-mentions. The issue was successfully reproduced in the separate application, suggesting the issue is here.
npx create-react-app
cd create-react-app
npm i react-mentions
Observed behaviour: I noticed unexpected cursor behavior while implementing Mentions in a larger application. When text is cut (cmd+x) from the MentionsInput, the cursor jumps to the end of the text area when the cut action is performed. Forcing the user to manually put the cursor into the place they want to type.
Expected behaviour: The cursor should remain in place when text is cut from the MentionsInput element.
Workaround: Users have to copy and delete rather than cut in order to keep the cursor in place.
Steps to reproduce: I created a small, separate react app to check if the cursor behavior was caused by my application or react-mentions. The issue was successfully reproduced in the separate application, suggesting the issue is here.
Replace all contents of App.js with:
Run the application
Navigate to your local host
Type several lines in the textarea
Cut any portion of the text and the cursor will jump to the end of the textarea