I am currently still investigating the problem, but what I am currently experiencing is that an infinite update loop is generated due to the fact that I am trying to do bi-directional sync between a model reactiveValues and a input text. This only occurs when there's a delay (e.g. of a second, induced by adding a Sys.sleep(1) into another handler that pauses the evaluation).
observeEvent({input$nameText},
{
print("name text changed")
print(input$nameText)
app_model$name <- input$nameText
})
observeEvent({app_model$name},
{
print("app model changed")
print(app_model$name)
updateTextInput(session, "nameText", value = app_model$name)
})
The problem seems to occur due to other events. This triggers traffic structured as such
{"method":"update","data":{"mainTab-sendReportUi-nameText":"Stefanos"}}
{"progress":{"type":"binding","message":{"id":"mainTab-sendReportUi-checklistUi"}}}
{"progress":{"type":"binding","message":{"id":"mainTab-sendReportUi-sendReportButtonUi"}}}
{"recalculating":{"name":"mainTab-sendReportUi-checklistUi","status":"recalculating"}}
{"recalculating":{"name":"mainTab-sendReportUi-checklistUi","status":"recalculated"}}
{"recalculating":{"name":"mainTab-sendReportUi-sendReportButtonUi","status":"recalculating"}}
{"recalculating":{"name":"mainTab-sendReportUi-sendReportButtonUi","status":"recalculated"}}
{"busy":"idle"}|15|14:16:16.295|
{"errors":{},"values":{"mainTab-sendReportUi-sendReportButtonUi":{"html":"<button id=\"mainTab-sendReportUi-sendReportButton\" type=\"button\" class=\"btn btn-default action-button\">\n <i class=\"fa fa-file\"><\/i>\n Send Report\n<\/button>","deps":[{"name":"font-awesome","version":"5.3.1","src":{"href":"font-awesome-5.3.1"},"meta":null,"script":null,"stylesheet":["css/all.min.css","css/v4-shims.min.css"],"head":null,"attachment":null,"all_files":true}]},"mainTab-sendReportUi-checklistUi":null},"inputMessages":[{"id":"mainTab-sendReportUi-nameText","message":{"value":"Stefanossssssssssssss"}}]}
{"busy":"busy"}
{"method":"update","data":{"mainTab-sendReportUi-nameText":"Stefanossssssssssssss"}}
and the cycle restarts.
What seems to be happening is that, due to the delay, the message about the bidirectional sync never gets extinguished due to equality on the client side.
I understand my question is vague, but I'd like to know how this kind of issue is generally handled.
Please note that renderUi has the nasty behavior of throwing away the subtree and replacing it with a new control, which means that the browser (especially IE) thinks that the page has been changed and, for example, concludes it's shorter. the result is that the scrollbar goes back to top.