DieselMeister / Terminal.Gui.Elmish

An elmish wrapper around Miguel de Icaza's 'Gui.cs' https://github.com/migueldeicaza/gui.cs including a fable like view DSL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TextView does not fire when user types, need to wire up some other properties

bjorn-einar-bjartnes-4ss opened this issue · comments

Description

TextView, the multi-line editor, does not fire onTextChanged as the user types (seems to be the desired behavior, as the text can be quite large strings in multi-line edit). Some other parameters (I haven't figured out excactly which and how) needs to be wired up in order to get the text the user types, it seems?

Repro steps

Please provide the steps required to reproduce the problem

  1. Run examples project

  2. Attach debugger to event

    textView.onTextChanged (fun e -> dispatch (ChangeText e))

  3. Change text and see it is not fired

Expected behavior

It is as-built, unlike one line textViews it is not firing, there needs to be something set up to the isDirty property
https://github.com/gui-cs/Terminal.Gui/blob/3d75be4ea60aa670544e39394b44adf6733a39df/Terminal.Gui/Views/TextView.cs#L1157

Known workarounds

Not actually sure, but there needs to be some other event to hook up to in order to get the actual text the user has typed.

ContentsChanged on TextView seems to be quite new, might need to update the underlying package to make this work as expected, perhaps as in #21

Hi Björn, I will try to fix the issues next week. Thanks for finding out :)

For some context, I am using it for my hobby-project only as of now. It is hopefully pushing the project a little bit beyond the demo cases, so hopfully I get to weed out some issues. Let me know if I can be of any help in fixing/testing! (also, I am the same person with a personal and work account that I have long given up on signing in and out of for replying to issues...)

Hi @DieselMeister,

First of all, great work

I've started using the TextView and I've hit this problem with the onTextChanged not firing. Do you have any update on this?