react-mentions icon indicating copy to clipboard operation
react-mentions copied to clipboard

Unable to copy rendered text when input is readonly

Open mokkymiah opened this issue 4 years ago • 3 comments

Steps to reproduce:

  1. Render input with readonly flag set to true and any text value e.g "Hello world"
  2. Using your mouse highlight the visible text
  3. Right click on your mouse
  4. Select copy
  5. Paste anywhere eg notepad.

Expected behaviour: Pasted value is "Hello world" Observed behaviour: empty Workaround: None so far

mokkymiah avatar Dec 29 '20 13:12 mokkymiah

Were you able to find a solution for this?

nikhil2kumar avatar Jun 11 '21 10:06 nikhil2kumar

It's not the right way, but it can be solved with expediency.

<MentionsInput
  // disabled
  value={value}
  spellCheck={false} // optional
  style={{
    ...mentionsInputDefaultStyle,
    control: {
      caretColor: 'transparent',
    },
  }}
>

It looks the same as using 'disabled'.

student513 avatar Aug 23 '21 08:08 student513

Add a reproducible example to show the issue: https://codesandbox.io/s/react-mentions-disabled-issue-zb33x?file=/src/App.js

image

rudnitskih avatar Nov 11 '21 11:11 rudnitskih