Closed misterspeedy closed 5 years ago
Added a pull request to the Terminal.Gui project to get the proper preconditions to fix the bug inside my code.
The Pull Request on Miguel's side ia already merged! Waiting for a new nuget version.
Amazing. Thanks!
fixed :)
Description
When a text field is edited with the cursor position somewhere other than the end of the field, the model-updating process ends up moving the text cursor to the end of the field.
Repro steps
Please provide the steps required to reproduce the problem
Run the demo
Go to the
TextFields
sectionClick in the middle of the
Text
field.Insert a character.
Expected behavior
Text cursor should remain after the last inserted character.
Actual behavior
Text cursor is now at the end of the field.
Known workarounds
This is an issue which affects other Elmish incarnations, because the
OnChanged
event of a field triggers a message, which triggers a model change, which changes the field value. In Fable browser apps (if I recall correctly) this can be worked around by setting theDefaultValue
property instead of theValue
property. It would be great to have a similar workaround here.Related information