feat: add custom copy/paste behaviour#333
Conversation
|
Not sure, if this is a good solution. Copying text with mentions to an non-react-mentions text input would have a bit of an unexpected result... |
|
@jfschwarz yes, but copying text from a mentions input to a mentions input would have the exact expected result ;) |
|
would it be an option to write the markup into the clipboard data as an extra format in addition to text/plain, then read from that one in the paste handling? |
|
Not sure what you mean by that. There is only one clipboard you can write to. |
|
Demo page for commit |
Codecov Report
@@ Coverage Diff @@
## master #333 +/- ##
==========================================
+ Coverage 73.86% 76.82% +2.95%
==========================================
Files 22 22
Lines 574 630 +56
Branches 90 95 +5
==========================================
+ Hits 424 484 +60
+ Misses 149 145 -4
Partials 1 1
Continue to review full report at Codecov.
|
|
@jfschwarz I could "hide" the new features behind an I'd also do this because currently, I have no idea how to write tests for this. Apparently, you can only really trigger the events with the correct targets etc. when a user interaction has happened on the page. |
|
Demo page for commit |
|
Demo page for commit |
|
@frontendphil What I meant is leveraging the possibility to write different formats to the clipboard. I've created a fiddle to demonstrate: https://jsfiddle.net/5np3zayd/1/ |
|
@jfschwarz nice approach. I'll directly steal that. I thought the data type has to be somewhat meaningful :D |
|
Demo page for commit |
|
I would probably still have this behind the |
|
Demo page for commit |
|
Demo page for commit |
182e8e4 to
8305745
Compare
|
This pull request is automatically deployed with Now. Latest deployment for this branch: https://react-mentions-git-improvement-copy-paste.wolf-pack.now.sh |
Fixes #66