I'm working with the Elmish.Bridge flavor of the SAFE stack.
(我正在使用SAFE堆栈的Elmish.Bridge风格。)
At the top level of the view, I create an input field like this:
(在视图的顶层,我创建一个像这样的输入字段:)
Input.input [ Input.Value(model.FieldValue); Input.OnChange(fun e -> dispatch (EditFieldValue(e.Value))) ]
When I edit that field's value by typing in the middle of it, the model is updated as expected, but the cursor also moves to the end of the input's text .
(当我通过在字段的中间输入来编辑该字段的值时,模型将按预期进行更新,但是光标也会移动到输入文本的末尾 。)
My model is several layers deep and is completely made of serializable types (primitives, strings, collections, records, and unions).
(我的模型有几层深,完全由可序列化的类型(基元,字符串,集合,记录和联合)组成。)
I tried reproducing this in a toy app (where the model is much less complicated), but it works as expected there - the cursor maintains position.
(我尝试在玩具应用程序(模型不那么复杂)中重现此内容,但它在那里正常工作-光标保持位置。)
Is there any way to determine why the cursor is moving under these circumstances?
(有什么方法可以确定在这种情况下光标为何移动?)
ask by Overlord Zurg translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…