I've encountered an issue with a draggable textarea created using react-rnd. The problem arises when I try to select text within the textarea, and accidentally move my cursor outside of the react-rnd component, causing the selection to change unexpectedly.
As demonstrated in the gif image below, if I attempt to select text starting from the letter 'o' and then reverse direction while moving out of the textbox, the selection changes to include everything after that 'o'. Is there a way to maintain the original selection ('hello') even when exiting the react-rnd component?
https://i.sstatic.net/NUkpt.gif
The issue does not occur when the textarea is placed outside of the draggable component. I have been grappling with this problem for over 2 days now and have yet to find a solution.
To better understand the problem, you can view a replica of it on the following codesandbox link: