I have a simple two-way binded component:
<input type="text" id="myInput" bind="@MyVar" />
...
@functions {
private string MyVar { get; set; } = "foo";
All runs fine when I write text on input box. But, if input value is set from javascript then blazor is no able to detect the changed value.
document.getElementById('myInput').value='Random Value';
I tried to raise some events on element like 'key pressed' and so but the private var MyVar has no changes on blazor client side.
I would like to send back to blazor some values from client, I guess changing value of a hidden input may be solution, but not working.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…