mirror of
https://github.com/flarum/core.git
synced 2025-07-21 08:41:17 +02:00
9b51edc939a1f9061bf0a80f01c8a8593de6b0f8
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
Description
No description provided
Languages
PHP
65.5%
JavaScript
14.2%
TypeScript
13.9%
Less
5.5%
Blade
0.7%
Other
0.2%