CanvasInput icon indicating copy to clipboard operation
CanvasInput copied to clipboard

text added via menu (e.g. Edit->Paste or special character menu) does not appear until next key press

Open okaybenji opened this issue 10 years ago • 3 comments

okaybenji avatar Aug 21 '15 15:08 okaybenji

I was also able to re-create this issue on the Linux side using highlight/middle for copy/paste, at least in the demo implementation. Assuming you are using this for quick chat on CasinoRPG, the highlight/middle for copy/paste does not work at all; I was able to get the other clipboard working. Mint 13 LTS, most recent version of Firefox. I am awaiting Mint 18 to upgrade because of a preference for LTS; I will accept if it works properly in more recent versions.

wschmrdr avatar Jun 03 '16 09:06 wschmrdr

OK, I think I have this one figured out. Looks like the self._hiddenInput.value (HIvalue) is getting updated on completion of the "paste" event. However, because self._value (Svalue) is what is being displayed to the user and isn't getting updated, you don't see what was pasted until the next keyup, when HIvalue is being added to with previous contents still there, and then Svalue is set equal to the HIvalue. Because since HIvalue isn't updated until after the paste event, I had to wrap the assignment of Svalue and re-render in a setTimeout with a delay of 1. I just copied the same code as the keyup, since it's the same functionality.

I'm going to put together a PR for this; be aware that I did not do any sort of custom functions for the paste. If necessary, that can be done.

wschmrdr avatar Dec 23 '18 02:12 wschmrdr

#38

wschmrdr avatar Dec 23 '18 02:12 wschmrdr