Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda