{"action":"closed","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/3923","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/3923/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/3923/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/3923/events","html_url":"https://github.com/driftyco/ionic/issues/3923","id":87486912,"number":3923,"title":"bug: Modal windows open and then close suddenly","user":{"login":"3melectronicmonitoring","id":942571,"avatar_url":"https://avatars.githubusercontent.com/u/942571?v=3","gravatar_id":"","url":"https://api.github.com/users/3melectronicmonitoring","html_url":"https://github.com/3melectronicmonitoring","followers_url":"https://api.github.com/users/3melectronicmonitoring/followers","following_url":"https://api.github.com/users/3melectronicmonitoring/following{/other_user}","gists_url":"https://api.github.com/users/3melectronicmonitoring/gists{/gist_id}","starred_url":"https://api.github.com/users/3melectronicmonitoring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3melectronicmonitoring/subscriptions","organizations_url":"https://api.github.com/users/3melectronicmonitoring/orgs","repos_url":"https://api.github.com/users/3melectronicmonitoring/repos","events_url":"https://api.github.com/users/3melectronicmonitoring/events{/privacy}","received_events_url":"https://api.github.com/users/3melectronicmonitoring/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic/labels/ionitron:closed","name":"ionitron:closed","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-11T20:31:38Z","updated_at":"2015-08-28T19:51:37Z","closed_at":"2015-08-28T19:51:37Z","body":"**Type**: <span ionic-type>bug</span>\n\n**Platform**: <span ionic-platform>android</span> <span ionic-platform-version>4.4</span>  <span ionic-webview>webview</span>\n\n<span ionic-description>My app was updated to the 1.0 release and I started having issues with modal windows opening on 4.4.2 android devices. \n\nI have a modal service that manages opening/closing/cleanup for modal windows and all modals are having this issue. The modal will open and then quickly close without any interaction from the user. You can see the open/close animations happen.\n\nIf I look at the console with dev tools for the device, I get an error that states \"Uncaught TypeError: Cannot read property 'offsetX' of null\". The error occurs in the ionSideMenuContent directive's content variable/object's setTranslateX() function:\n\n        var content = {\n          element: element[0],\n          onDrag: function() {},\n          endDrag: function() {},\n          getTranslateX: function() {\n            return $scope.sideMenuContentTranslateX || 0;\n          },\n          setTranslateX: ionic.animationFrameThrottle(function(amount) {\n            var xTransform = content.offsetX + amount; // <- ERROR HERE!\n            $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(' + xTransform + 'px,0,0)';\n            $timeout(function() {\n              $scope.sideMenuContentTranslateX = amount;\n            });\n          }),\n          // ....\n        }\n\nHere's a codepen with an example of the usage of my modalService. \n\nhttp://codepen.io/anon/pen/XbgEpX\n\nIt works in the browser but the issue happens in android 4.4.2 so I'm not sure how helpful this will be.</span>\n\n<span is-issue-template></span>\n"}}