Mohit Chandak
Mohit Chandak

Reputation: 9

How to disable paste in Cloud9 Ace Code Editor?

I am using CloudA9 Code Editor for my College Project. How can I disable the Paste in Editor.

Upvotes: 1

Views: 982

Answers (1)

Harsha pps
Harsha pps

Reputation: 2208

you can use

stop = function(e) { 
    e.stopPropagation(); e.preventDefault(); console.log(e) 
}
document.querySelector(".ace_editor").addEventListener("paste", stop, true);

or

editor.onPaste = function() { return ""; }

Upvotes: 2

Related Questions