{"action":"created","issue":{"url":"https://api.github.com/repos/ianstormtaylor/slate/issues/1744","repository_url":"https://api.github.com/repos/ianstormtaylor/slate","labels_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/1744/labels{/name}","comments_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/1744/comments","events_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/1744/events","html_url":"https://github.com/ianstormtaylor/slate/issues/1744","id":310020713,"number":1744,"title":"Using <input> inside a contenteditable=\"false\" is broken in Firefox","user":{"login":"Zhouzi","id":2291025,"avatar_url":"https://avatars1.githubusercontent.com/u/2291025?v=4","gravatar_id":"","url":"https://api.github.com/users/Zhouzi","html_url":"https://github.com/Zhouzi","followers_url":"https://api.github.com/users/Zhouzi/followers","following_url":"https://api.github.com/users/Zhouzi/following{/other_user}","gists_url":"https://api.github.com/users/Zhouzi/gists{/gist_id}","starred_url":"https://api.github.com/users/Zhouzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zhouzi/subscriptions","organizations_url":"https://api.github.com/users/Zhouzi/orgs","repos_url":"https://api.github.com/users/Zhouzi/repos","events_url":"https://api.github.com/users/Zhouzi/events{/privacy}","received_events_url":"https://api.github.com/users/Zhouzi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-30T09:28:33Z","updated_at":"2018-03-30T17:00:51Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"We noticed a bug in Firefox, rendering a node as follows is broken:\r\n\r\n```html\r\n<div contenteditable=\"false\">\r\n  <input type=\"text\" />\r\n</div>\r\n```\r\n\r\nThere are two things to note:\r\n\r\n1. Left/right arrow keys don't move the caret\r\n2. Pressing a character key (or backspace) throws an error:\r\n\r\n> Permission denied to access property \"nodeType\"\r\n\r\nI created a [repository](https://github.com/Zhouzi/slate-firefox-bug) reproducing the error with Slate and a minimal setup:\r\nhttp://gabinaureche.com/slate-firefox-bug/\r\n\r\nThe error comes from `isInEditor` which tries to read `window.getSelection().anchorNode.nodeType` but `anchorNode` is \"Restricted\".\r\n\r\nThis bug is reproducible without Slate, here's a pretty simple scenario:\r\nhttps://jsfiddle.net/hsqebsk2/1/\r\n\r\nI filed an issue to Firefox:\r\nhttps://bugzilla.mozilla.org/show_bug.cgi?id=1449936\r\n\r\nProbably related to #843 \r\n"},"comment":{"url":"https://api.github.com/repos/ianstormtaylor/slate/issues/comments/377570637","html_url":"https://github.com/ianstormtaylor/slate/issues/1744#issuecomment-377570637","issue_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/1744","id":377570637,"user":{"login":"CameronAckermanSEL","id":14242948,"avatar_url":"https://avatars1.githubusercontent.com/u/14242948?v=4","gravatar_id":"","url":"https://api.github.com/users/CameronAckermanSEL","html_url":"https://github.com/CameronAckermanSEL","followers_url":"https://api.github.com/users/CameronAckermanSEL/followers","following_url":"https://api.github.com/users/CameronAckermanSEL/following{/other_user}","gists_url":"https://api.github.com/users/CameronAckermanSEL/gists{/gist_id}","starred_url":"https://api.github.com/users/CameronAckermanSEL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CameronAckermanSEL/subscriptions","organizations_url":"https://api.github.com/users/CameronAckermanSEL/orgs","repos_url":"https://api.github.com/users/CameronAckermanSEL/repos","events_url":"https://api.github.com/users/CameronAckermanSEL/events{/privacy}","received_events_url":"https://api.github.com/users/CameronAckermanSEL/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T17:00:51Z","updated_at":"2018-03-30T17:00:51Z","author_association":"CONTRIBUTOR","body":"This can be worked around by using \r\n\r\n```\r\n\r\n<div contenteditable>\r\n    <div contenteditable=\"false\">\r\n        <input type=\"text\" value=\"Some text content\">\r\n    </div>\r\n</div>\r\n```\r\n\r\nOr by using the componentDidThrow() react event handler to keep these errors from crashing the editor.\r\n\r\nI also don't think this is a Slate bug."}}
{"actor":{"display_login":"CameronAckermanSEL"}}