Use onkeypress to force IE to do onchange when RETURN is pressed (resolves bug reproted at https://sourceforge.net/projects/mathjax/forums/forum/948701/topic/3862906)

git-svn-id: https://mathjax.svn.sourceforge.net/svnroot/mathjax/trunk@608 b8fd5906-0fad-46e2-a0d3-10d94ff285d1
This commit is contained in:
Davide Cervone 2010-09-23 11:12:15 +00:00
parent 81a1413d19
commit 4965070442

View File

@ -50,5 +50,18 @@ Type some TeX code and press RETURN:<br/>
You typed: ${}$
</div>
<script>
//
// IE doesn't fire onchange events for RETURN, so
// use onkeypress to do a blur (and refocus) to
// force the onchange to occur
//
if (MathJax.Hub.Browser.isMSIE) {
window.MathInput.onkeypress = function () {
if (window.event && window.event.keyCode === 13) {this.blur(); this.focus()}
}
}
</script>
</body>
</html>