{"action":"created","issue":{"url":"https://api.github.com/repos/liferay/alloy-editor/issues/371","labels_url":"https://api.github.com/repos/liferay/alloy-editor/issues/371/labels{/name}","comments_url":"https://api.github.com/repos/liferay/alloy-editor/issues/371/comments","events_url":"https://api.github.com/repos/liferay/alloy-editor/issues/371/events","html_url":"https://github.com/liferay/alloy-editor/issues/371","id":115052333,"number":371,"title":"toolbar does not disappear","user":{"login":"kel093","id":6705879,"avatar_url":"https://avatars.githubusercontent.com/u/6705879?v=3","gravatar_id":"","url":"https://api.github.com/users/kel093","html_url":"https://github.com/kel093","followers_url":"https://api.github.com/users/kel093/followers","following_url":"https://api.github.com/users/kel093/following{/other_user}","gists_url":"https://api.github.com/users/kel093/gists{/gist_id}","starred_url":"https://api.github.com/users/kel093/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kel093/subscriptions","organizations_url":"https://api.github.com/users/kel093/orgs","repos_url":"https://api.github.com/users/kel093/repos","events_url":"https://api.github.com/users/kel093/events{/privacy}","received_events_url":"https://api.github.com/users/kel093/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/liferay/alloy-editor/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/liferay/alloy-editor/milestones/24","html_url":"https://github.com/liferay/alloy-editor/milestones/0.7.0","labels_url":"https://api.github.com/repos/liferay/alloy-editor/milestones/24/labels","id":1361799,"number":24,"title":"0.7.0","description":"","creator":{"login":"ipeychev","id":78014,"avatar_url":"https://avatars.githubusercontent.com/u/78014?v=3","gravatar_id":"","url":"https://api.github.com/users/ipeychev","html_url":"https://github.com/ipeychev","followers_url":"https://api.github.com/users/ipeychev/followers","following_url":"https://api.github.com/users/ipeychev/following{/other_user}","gists_url":"https://api.github.com/users/ipeychev/gists{/gist_id}","starred_url":"https://api.github.com/users/ipeychev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipeychev/subscriptions","organizations_url":"https://api.github.com/users/ipeychev/orgs","repos_url":"https://api.github.com/users/ipeychev/repos","events_url":"https://api.github.com/users/ipeychev/events{/privacy}","received_events_url":"https://api.github.com/users/ipeychev/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":3,"state":"open","created_at":"2015-10-17T19:53:40Z","updated_at":"2015-11-06T05:59:48Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-11-04T13:33:03Z","updated_at":"2015-11-06T06:46:37Z","closed_at":"2015-11-06T05:59:48Z","body":"Hello. I am apologise if i duplicate the issue, but i don't found it in list of issue's. \r\nI am using the AlloyEditor and today saw strange behaviour. I selected the text after this the toolbar is appears, then i clicked on the any place on the screen and the toolbar does not disappear.\r\n![bug](https://cloud.githubusercontent.com/assets/6705879/10938785/733cd998-8305-11e5-8f06-c7c6d1b3e051.png)\r\n\r\nI investigated how plugin works and understood the problem, the problem is that editor.status == \"ready\" and listener \"contentDom\" will not be called. That's means that listeners \"mousedown\" and \"keydown\" are not be added to document.\r\n\r\nI fixed this problem, please see my changes in function componentDidMount().\r\n\r\n            if (editor && editor.status == \"ready\") {\r\n                document.addEventListener('mousedown', this._mousedownListener);\r\n                document.addEventListener('keydown', this._keyDownListener);\r\n            } else {\r\n                editor.once('contentDom', (function () {\r\n                    document.addEventListener('mousedown', this._mousedownListener);\r\n                    document.addEventListener('keydown', this._keyDownListener);\r\n                }).bind(this));\r\n            }"},"comment":{"url":"https://api.github.com/repos/liferay/alloy-editor/issues/comments/154328556","html_url":"https://github.com/liferay/alloy-editor/issues/371#issuecomment-154328556","issue_url":"https://api.github.com/repos/liferay/alloy-editor/issues/371","id":154328556,"user":{"login":"jbalsas","id":905006,"avatar_url":"https://avatars.githubusercontent.com/u/905006?v=3","gravatar_id":"","url":"https://api.github.com/users/jbalsas","html_url":"https://github.com/jbalsas","followers_url":"https://api.github.com/users/jbalsas/followers","following_url":"https://api.github.com/users/jbalsas/following{/other_user}","gists_url":"https://api.github.com/users/jbalsas/gists{/gist_id}","starred_url":"https://api.github.com/users/jbalsas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbalsas/subscriptions","organizations_url":"https://api.github.com/users/jbalsas/orgs","repos_url":"https://api.github.com/users/jbalsas/repos","events_url":"https://api.github.com/users/jbalsas/events{/privacy}","received_events_url":"https://api.github.com/users/jbalsas/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T06:46:37Z","updated_at":"2015-11-06T06:46:37Z","body":"mmm... that's weird, they were passing for me... I guess only added the change for the `ae-editable` class part at the end and forgot to re-run the tests :(\r\n\r\nOf course it makes sense that test will fail, we should update the initialization of the editors to fire a `focus` event before doing anything else. This is what will actually happen in practice when a user tries to work with the editor, isn't it?\r\n\r\nThe only thing that worried me was that some styling could flicker but I didn't see anything weird.\r\n\r\nIn any case I don't think attaching the events always will cause other issues. Will check later.\r\n\r\nTHanks!"}}