{"action":"created","issue":{"url":"https://api.github.com/repos/ckeditor/ckeditor5/issues/1244","repository_url":"https://api.github.com/repos/ckeditor/ckeditor5","labels_url":"https://api.github.com/repos/ckeditor/ckeditor5/issues/1244/labels{/name}","comments_url":"https://api.github.com/repos/ckeditor/ckeditor5/issues/1244/comments","events_url":"https://api.github.com/repos/ckeditor/ckeditor5/issues/1244/events","html_url":"https://github.com/ckeditor/ckeditor5/issues/1244","id":359064244,"node_id":"MDU6SXNzdWUzNTkwNjQyNDQ=","number":1244,"title":"Unable to cancel associated keystroke on calling cancel API","user":{"login":"kapilgupta77","id":21102462,"node_id":"MDQ6VXNlcjIxMTAyNDYy","avatar_url":"https://avatars2.githubusercontent.com/u/21102462?v=4","gravatar_id":"","url":"https://api.github.com/users/kapilgupta77","html_url":"https://github.com/kapilgupta77","followers_url":"https://api.github.com/users/kapilgupta77/followers","following_url":"https://api.github.com/users/kapilgupta77/following{/other_user}","gists_url":"https://api.github.com/users/kapilgupta77/gists{/gist_id}","starred_url":"https://api.github.com/users/kapilgupta77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapilgupta77/subscriptions","organizations_url":"https://api.github.com/users/kapilgupta77/orgs","repos_url":"https://api.github.com/users/kapilgupta77/repos","events_url":"https://api.github.com/users/kapilgupta77/events{/privacy}","received_events_url":"https://api.github.com/users/kapilgupta77/received_events","type":"User","site_admin":false},"labels":[{"id":631577521,"node_id":"MDU6TGFiZWw2MzE1Nzc1MjE=","url":"https://api.github.com/repos/ckeditor/ckeditor5/labels/package:utils","name":"package:utils","color":"fef2c0","default":false},{"id":285244012,"node_id":"MDU6TGFiZWwyODUyNDQwMTI=","url":"https://api.github.com/repos/ckeditor/ckeditor5/labels/status:confirmed","name":"status:confirmed","color":"e6e6e6","default":false},{"id":164194247,"node_id":"MDU6TGFiZWwxNjQxOTQyNDc=","url":"https://api.github.com/repos/ckeditor/ckeditor5/labels/type:bug","name":"type:bug","color":"dd4444","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-09-11T14:07:08Z","updated_at":"2018-09-12T12:17:49Z","closed_at":null,"author_association":"NONE","body":"## Is this a bug report or feature request? (choose one)\r\n\r\n🐞 Bug report\r\n\r\n## 💻 11.0.1\r\n\r\n\r\n\r\n## 📋 Steps to reproduce\r\n\r\n1. Associate a keystroke callback function with editor using below code\r\n  ```\r\neditor.keystrokes.set( \"delete\", this.deleteKeyHandler, { priority : \"highest\" } );\r\n\r\n  private deleteKeyHandler(ev, cancel){\r\n        cancel();\r\n    }\r\n```\r\n\r\n2. Press delete key in the editor\r\n\r\n## ✅ Delete key should not work\r\n\r\n## ❎ Delete key is working\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ckeditor/ckeditor5/issues/comments/420626952","html_url":"https://github.com/ckeditor/ckeditor5/issues/1244#issuecomment-420626952","issue_url":"https://api.github.com/repos/ckeditor/ckeditor5/issues/1244","id":420626952,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDYyNjk1Mg==","user":{"login":"f1ames","id":1061942,"node_id":"MDQ6VXNlcjEwNjE5NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1061942?v=4","gravatar_id":"","url":"https://api.github.com/users/f1ames","html_url":"https://github.com/f1ames","followers_url":"https://api.github.com/users/f1ames/followers","following_url":"https://api.github.com/users/f1ames/following{/other_user}","gists_url":"https://api.github.com/users/f1ames/gists{/gist_id}","starred_url":"https://api.github.com/users/f1ames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1ames/subscriptions","organizations_url":"https://api.github.com/users/f1ames/orgs","repos_url":"https://api.github.com/users/f1ames/repos","events_url":"https://api.github.com/users/f1ames/events{/privacy}","received_events_url":"https://api.github.com/users/f1ames/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T12:17:49Z","updated_at":"2018-09-12T12:17:49Z","author_association":"MEMBER","body":"@kapilgupta77 That's the different question, but you can simply assign `editor.model` to a variable and use it inside your locally defined function:\r\n\r\n```js\r\nconst editorModel = this.editor.model;\r\n\r\nfunction deleteKeyHandler( evt, data ) {\r\n    // editorModel\r\n}\r\n\r\nthis.editor.editing.view.document.on( 'delete', deleteKeyHandler, { priority: 'high' } );\r\n```\r\n\r\nor use scoping function/method:\r\n\r\n```js\r\nthis.editor.editing.view.document.on( 'delete', this.deleteKeyHandler(), { priority: 'high' } );\r\n\r\ndeleteKeyHandler() {\r\n    const editorModel = this.editor.model;\r\n    return ( evt, data ) => { // editorModel }\r\n}\r\n```\r\n\r\nPlease remember that if you have separate issues they should be reported in a separate issues/tickets. For questions you can go to [our gitter](https://gitter.im/ckeditor/ckeditor5) or [Stack Overflow](https://stackoverflow.com/search?q=ckeditor5)."}}
{"actor":{"display_login":"f1ames"}}