framework/js
Toby Zerner 538a3e5e98 Prevent infinite redraw loop in IE
Welp, this is probably the most subtle bug I've ever tracked down and fixed.

Turns out that IE has this bug where the "oninput" event will be triggered whenever the "placeholder" attribute is changed. Most placeholders get their value from app.trans. The app.trans method returns a VirtualElement – which is an array, not a string! That means when Mithril's diffing algorithm was comparing the old value to the new value, it was comparing two different array instances, and thus deciding the value was dirty and the placeholder attribute needed to be updated. Due to the IE bug, that was leading to the "oninput" event being triggered... and then through Mithril's auto-redraw mechanism, a redraw would be triggered, and so the cycle continued.

Since the inputs in the LogInModal (among others) only update the component state on the "onchange" event (i.e. when the input loses focus), the intermittent redraws would cause the input's value to be cleared continuously. That's what was causing #464. Could've been easily and superficially patched by changing them to use "oninput" events, but luckily I dived a little deeper!

Glad that's over. Running IE11's buggy dev tools in an underpowered VM isn't fun. Would not recommend.

closes #464
2015-09-25 23:44:15 +09:30
..
admin Revises the dashboard links to emphasize beta testing procedure. 2015-09-25 12:55:13 +09:00
forum Prevent infinite redraw loop in IE 2015-09-25 23:44:15 +09:30
lib Remove core key reorganization comments 2015-09-24 14:22:32 +09:30
.gitignore Share bower components between forum/admin 2015-05-05 09:16:34 +09:30
bower.json Patch Mithril with a bidi attribute 2015-09-18 13:06:37 +09:30