-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy/Cut/Paste not available in context-menu #3238
Comments
Does the problem occur on the demos on http://codemirror.net? I just tried (Chrome 42, Mountain Lion), and copy/paste from the context menu worked fine. |
Well, yes, the demos work, and after some digging I realized that the fix I did here yelvert@714cf11 to fix is what caused the context menu yo stop working correctly. So my real issue is the text box showing up when right clicking and never going away. If I need to create a new ticket I will. |
I'm experiencing the same issue. The demos on CodeMirror's website are fine (I have copy/cut/paste in the context menu), but in the editor we use in our application, no dice in any browser. Is there a workaround I could use to work around this issue? Thank you. |
Try to narrow it down -- something in your site is causing it, so remove pieces one by one until it goes away, then figure out what precise line did it. It is likely a CSS conflict, but might be something else. |
I can reproduce this in Chrome using the example given in #2154 (http://output.jsbin.com/ihunin/328/). Thus that is not only a FF bug. The editor is in my case in a modal screen which has transform CSS options. When I move the editor out of the modal screen it does work. Any clue? I guess using a CSS transform should not remove copy/paste functionallity. |
In the JSBin case, it seems to be caused by a mysterious no-op CSS transform they inject:
Why a zero-translate would have an effect on the position of the textarea I don't know. |
Actually, some further testing suggests that a 3d transform prevents the trick where CodeMirror puts a textarea under the cursor from working because it makes it appear on the screen asynchronously, possibly due to some interaction with the graphics hardware being needed, which prevents the context menu click from taking effect on that textarea. So yeah, 3d transforms on the body break CodeMirror's textarea hack. |
Hold on, I misdiagnosed that. It's not about async/sync relayout, it's about a weird position computation for a <!doctype html>
<body style="margin: 10px">
<div style="position: fixed; left: 0px; top: 0px; border: 1px solid black">Fixed at 0,0px</div>
<button onclick="document.body.style.transform = document.body.style.transform ? '' : 'translate(0,0)'">Toggle transform</button>
</body> Chrome and Firefox share this behavior so I guess it is somehow standard? Seems somewhat awful regardless. |
Okay, I'll stop spamming soon. It appears that you can't use |
Mm that sucks :/. Thanks for helping me out here! The thing is: my use case is pretty normal (I guess) as I am rendering Codemirror inside of a Bootstrap modal. The |
It doesn't work inside of a transformed container, even for zero transforms (which some components seem to love putting on root elements, for whichever reason) Closes #3238
I think attached patch helps here. |
And.. it's gone! That totally fixes the problem. Thank you very much for helping out. Once new release lands I'll update. PS. also thank you for your awesome book that I'll pass around to new faces at our company ;) |
I have had to revert this fix - dfeafe0 - when loading CodeMirror inside an iframe. Does anyone else experience this? |
This is Chrome on OSX
copy/cut/paste isn't available on any browser on any OS. Im using angular ui-codemirror but ive tried initializing it manually and have the same problem so I don't think its related.
The options I'm using are:
The text was updated successfully, but these errors were encountered: