Plugin Author
pepe
(@pputzer)
Hi @dawasi!
No, there is no special reason, but that was probably the most compatible API at the time. I’ll have to dive into that and port the code to a more modern idiom.
Thread Starter
WanDal
(@dawasi)
Hi @pputzer
All right, many thanks!
In the meantime, I’ll dequeue the script on problematic pages.
Regards
dawasi
Plugin Author
pepe
(@pputzer)
I’ve been thinking about it. toString() will strip the markup, which differs from browser-native clipboard behavior.
Plugin Author
pepe
(@pputzer)
I’ve created a GitHub issue for this. We should discuss it further overthere, if necessary.
Thread Starter
WanDal
(@dawasi)
Thank you very much for your research.
As I was able to work around the problem by dequeing the problematic scripts and as the problem cannot be solved easily, no further clarifications are necessary for me.
Many thanks
dawasi
Plugin Author
pepe
(@pputzer)
Hi @dawasi, I’ve been experimenting with this. Just to get the actual bug straight: You were having this issue when copying using from within a single form field? Not when the selection happens to include a form field?
-
This reply was modified 6 years ago by
pepe.
Thread Starter
WanDal
(@dawasi)
Hi @pputzer
I would be happy to see such an effort from other plugin developers as well.
I was having the issues when copying from within a single disabled form field.
Users can embed certain parts of our website. To provide an easy way to copy the code, we use disabled form fields. However, the code in these fields cannot be copied if the clean-clipboard.min.js script is enabled.
I hope this brings some clarity.
Thanks a lot!
Plugin Author
pepe
(@pputzer)
Thanks. That’s an actual bug in the script. The Selection API does not really work with form fields and has no specified mechanism to reliably modify text selected in a field. (Instead, starting from release 5.7.0, when form field text is selected, the script will just do nothing.)