{"action":"created","issue":{"url":"https://api.github.com/repos/google/blockly/issues/17","labels_url":"https://api.github.com/repos/google/blockly/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/google/blockly/issues/17/comments","events_url":"https://api.github.com/repos/google/blockly/issues/17/events","html_url":"https://github.com/google/blockly/issues/17","id":50459219,"number":17,"title":"Field editors don't work on iOS 8","user":{"login":"toolness","id":124687,"avatar_url":"https://avatars.githubusercontent.com/u/124687?v=3","gravatar_id":"","url":"https://api.github.com/users/toolness","html_url":"https://github.com/toolness","followers_url":"https://api.github.com/users/toolness/followers","following_url":"https://api.github.com/users/toolness/following{/other_user}","gists_url":"https://api.github.com/users/toolness/gists{/gist_id}","starred_url":"https://api.github.com/users/toolness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolness/subscriptions","organizations_url":"https://api.github.com/users/toolness/orgs","repos_url":"https://api.github.com/users/toolness/repos","events_url":"https://api.github.com/users/toolness/events{/privacy}","received_events_url":"https://api.github.com/users/toolness/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-11-30T14:26:25Z","updated_at":"2015-01-08T17:26:33Z","closed_at":null,"body":"Hey, I'm not sure if this has been reported--I haven't found any mention of it on the internet, so I'm wondering if I'm going a little insane, to be honest--but field editors don't seem to work on iOS 8. Even on Blockly's official demos, like the one at the top of https://developers.google.com/blockly/.\r\n\r\nOver the past several weeks, I have tried this on two iOS 8 devices with the latest updates installed: an iPhone 5 and an iPad Air. Both seem to exhibit the same behavior: any editable field, such as field dropdowns and colour fields, can be \"highlighted\" (i.e. have a solid white border drawn around them when tapped) but nothing else happens: no popup or `window.prompt` is shown.\r\n\r\nI've found that **removing** the following conditional from `Blockly.Field.prototype.onMouseUp_` in [core/field.js](https://github.com/google/blockly/blob/master/core/field.js#L269-L273) fixes this for me:\r\n\r\n```javascript\r\n  if ((goog.userAgent.IPHONE || goog.userAgent.IPAD) &&\r\n      e.layerX !== 0 && e.layerY !== 0) {\r\n    // iOS spawns a bogus event on the next touch after a 'prompt()' edit.\r\n    // Unlike the real events, these have a layerX and layerY set.\r\n    return;\r\n```\r\n\r\nMy only guess is that at some point Safari on iOS actually started setting `layerX` and `layerY` for their real events, which meant that *all* real events were being interpreted as bogus events, thereby being eaten up by the above code. But I am also extremely unfamiliar with how Blockly's UI works, so it's just a guess. I also have no idea if removing the above conditional causes some kind of regression, though in my brief testing (including experimenting with fields that cause a `prompt()` edit) does not seem to indicate it.\r\n\r\nIf my thinking is right, though, I suspect this *does* cause regressions on iOS devices that still have old versions of Safari/iOS, so perhaps a more robust fix would be to just add an extra conditional that looks at the user agent's version of Safari/iOS and only no-ops if it's below a certain version. I'm not sure how many iOS devices \"in the wild\" are still on this old version, though, and the task of figuring out which Safari/iOS version \"broke\" Blockly's field editors still needs to be done.\r\n\r\nIn any case, if any of my solutions described above seem like a reasonable fix, I'm happy to submit a formal PR."},"comment":{"url":"https://api.github.com/repos/google/blockly/issues/comments/69214967","html_url":"https://github.com/google/blockly/issues/17#issuecomment-69214967","issue_url":"https://api.github.com/repos/google/blockly/issues/17","id":69214967,"user":{"login":"neverbot","id":883793,"avatar_url":"https://avatars.githubusercontent.com/u/883793?v=3","gravatar_id":"","url":"https://api.github.com/users/neverbot","html_url":"https://github.com/neverbot","followers_url":"https://api.github.com/users/neverbot/followers","following_url":"https://api.github.com/users/neverbot/following{/other_user}","gists_url":"https://api.github.com/users/neverbot/gists{/gist_id}","starred_url":"https://api.github.com/users/neverbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neverbot/subscriptions","organizations_url":"https://api.github.com/users/neverbot/orgs","repos_url":"https://api.github.com/users/neverbot/repos","events_url":"https://api.github.com/users/neverbot/events{/privacy}","received_events_url":"https://api.github.com/users/neverbot/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T17:26:33Z","updated_at":"2015-01-08T17:26:33Z","body":"Anybody working on this issue?\r\nDon't know for sure if any of the workarounds mentioned above solve the problem without creating new ones."}}