{"action":"opened","issue":{"url":"https://api.github.com/repos/mathquill/mathquill/issues/601","repository_url":"https://api.github.com/repos/mathquill/mathquill","labels_url":"https://api.github.com/repos/mathquill/mathquill/issues/601/labels{/name}","comments_url":"https://api.github.com/repos/mathquill/mathquill/issues/601/comments","events_url":"https://api.github.com/repos/mathquill/mathquill/issues/601/events","html_url":"https://github.com/mathquill/mathquill/issues/601","id":145657390,"number":601,"title":"Using .latex method causes edit handler to fire twice","user":{"login":"YakovL","id":1131924,"avatar_url":"https://avatars.githubusercontent.com/u/1131924?v=3","gravatar_id":"","url":"https://api.github.com/users/YakovL","html_url":"https://github.com/YakovL","followers_url":"https://api.github.com/users/YakovL/followers","following_url":"https://api.github.com/users/YakovL/following{/other_user}","gists_url":"https://api.github.com/users/YakovL/gists{/gist_id}","starred_url":"https://api.github.com/users/YakovL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YakovL/subscriptions","organizations_url":"https://api.github.com/users/YakovL/orgs","repos_url":"https://api.github.com/users/YakovL/repos","events_url":"https://api.github.com/users/YakovL/events{/privacy}","received_events_url":"https://api.github.com/users/YakovL/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-04T11:30:13Z","updated_at":"2016-04-04T11:30:13Z","closed_at":null,"body":"So, here's a very basic self-explanatory (I believe) example showing the bug. Type `window.mathField.latex(\"smth\")` in console, that will fire the edit handler which writes the message twice (hence it is called twice). I also tried to create a [jsFiddle](https://jsfiddle.net/rgw7z413/), but it requires loading libs through https which seems to be unavailable (or I should use some other address?).\r\n\r\n```\r\n<html>\r\n  <head>\r\n    <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></script>\r\n    <!-- works with libs loaded localy, too -->\r\n    <script src=\"http://mathquill.com/lib/mathquill.js\"></script>\r\n    <link rel=\"stylesheet\" href=\"http://mathquill.com/lib/mathquill.css\" type=\"text/css\" />\r\n  </head>\r\n  <body>\r\n\t<!-- if window.mathField.latex(\"smth\") is called, edit handler fires twice, see the console -->\r\n\t<span id=\"mathquill\"></span>\r\n\t<script>\r\n\t  var mathFieldSpan = document.getElementById('mathquill');\r\n\t  var MQ = MathQuill.getInterface(2);\r\n\t  window.mathField = MQ.MathField(mathFieldSpan, {\r\n        spaceBehavesLikeTab: true,\r\n\t\thandlers: {\r\n\t\t  edit: function() { // useful event handlers\r\n\t\t    console.log(\"edit handler is called\");\r\n\t\t  }\r\n\t\t}\r\n\t  });\r\n\t</script>\r\n  </body>\r\n</html>\r\n```\r\n\r\nThis is a bug, right? If so, a quick inline fix would be very appreciated (for my current project, I'll probably change the local lib code or use another workaround until this is fixed in the main lib)."}}