Today, I posted a question about strange behavior related to input value updating. Before someone suggests a solution, I am trying to do a workaround. For this I thought that I will control this input completely from JS. To do so, however, I would prefer to send the initial value from Elm. So I wrote the following port code:
On further trials, I figured that this is likely due to the fact that when Elm sends the value to JS, the JS is not yet ready. I think this might be the case because if I insert a wait (using Process.sleep) and then send the value, it is logged to the console on the initial fresh load.
Updated question: Is there a DOMContentLoaded on Elm, so that I can send the value after the DOM is loaded and ready to go? Using an arbitrary sleep does not seem like a good solution?