JordanMarr / ReactiveElmish.Avalonia

Static Avalonia views for Elmish programs
Other
94 stars 8 forks source link

SourceList.clear - Losing data grid in Chart view #31

Closed houstonhaynes closed 10 months ago

houstonhaynes commented 10 months ago

Just an FYI - I'm looking at this for the first time in a while and just noticed that the "Actions" list is getting dropped in the UI. I believe that this is happening on "Reset"

[v2-beta]

https://github.com/JordanMarr/ReactiveElmish.Avalonia/assets/8174976/c78e4c4b-2efb-4f4d-8c9b-4e4e3292df53

houstonhaynes commented 10 months ago

To confirm I removed SourceList.clear and the issue went away (and the Actions list never clears, which I don't mind)

houstonhaynes commented 10 months ago

I tried this - no difference. I'm not sure what might cause the entire UI element to disappear. It's out of my depth.

| Reset ->
            // insert new Series - send the current series length to the newSeries function
            model.Series.[0].Values <- newSeries(Some values.Count)
            model.Actions.Clear() 
            model.Actions.Add({ Description = "Reset Chart"; Timestamp = DateTime.Now })
            { model with IsAutoUpdateChecked = false }
houstonhaynes commented 10 months ago

OK - last experiment - also the same behavior...

| Reset ->
            // insert new Series - send the current series length to the newSeries function
            model.Series[0].Values <- newSeries(Some values.Count)
            { model with
                // deactivate the AutoUpdate ToggleButton in the UI
                IsAutoUpdateChecked = false 
                Actions = model.Actions |> SourceList.clear |> ignore
                          |> SourceList.create
                          |> SourceList.add  { Description = "Reset Chart"; Timestamp = DateTime.Now } }

SourceList.clear seems to do some unkind things to the model context

JordanMarr commented 10 months ago

Hmm. Interesting!

JordanMarr commented 10 months ago

Removing SourceList.clear doesn't fix it for me. Never mind, I had to do a Rebuild. 🤷‍♂️

JordanMarr commented 10 months ago

v1.0.0-beta.4