Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 [open-formulieren/open-forms#3511] Fix flickering inputs on Webkit …
…browsers Some difference in the JS engine in WebKit (the browser engine behind Safari or any other browser on iOS/MacOS) vs. Gecko (Firefox) and Blink (Chromium, Edge) seems to cause a different (debounce) behaviour and or event firing/acting on events w/r to the Formio renderer. On Webkit, the formio initialized event triggered with mismatching backend data, causing the form field inputs to be cleared and the submission to be updated, which in turn triggers the logic check again due to a change event being fired. This then leads again to a change in the formio configuration and the formio renderer re-initializing, ad infinitum. Somewhere the form data and form configuration state goes out of sync and it's incredibly hard to manage this, especially due to the large number of related issues in the past. Since we use the formio initialized event pretty much only to form step data from earlier submissions or when navigating between steps, we avoid setting updated form data at all in formio initialized events triggered by logic evaluations. The logic evaluation itself already manages the form instance submission data, in case that the backend returns calculated/derived values, for example. I truly hope this doesn't break anything else, but due to the lack of tests (granted, it's near impossible to test this mess) and complexity of this part of the code base, I can't say I'm very confident in this fix.
- Loading branch information