Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
While selecting text inside a react-rnd, and if selection goes out of the draggable component, the selection changes

I implemented a draggable textarea using react-rnd by having the textarea component inside of the react-rnd component. Now when I try to select the text inside the textarea by using the cursor and if I accidentally go out of the react-rnd component, the selection changes.

The problem is illustrated in the gif image below. Here, I try to select the text from 'o' and go in the reverse direction and when I go out of the textbox, the selection changes and everything after that 'o' letter is selected. How to retain the original selection 'hello' in this case even when I go out of the react-rnd component.

enter image description here

The problem does not occur if I take the textarea out of the draggable component. I am struck with this issue for more than 2 days and I am yet to find a solution for this.

I created the replica of my issue in the below codesandbox.

https://codesandbox.io/s/lucid-sky-bl33e?file=/src/App.js

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Since the there is a problem in user selection, You can add a copy or select the text button for that text area.

See the following website for implementing that button: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_copy_clipboard

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!