mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
Simple forum software for building great communities.
9b51edc939
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 |
||
---|---|---|
framework/core |