fabulous-dev / Fabulous

Declarative UI framework for cross-platform mobile & desktop apps, using MVU and F# functional programming
https://fabulous.dev
Apache License 2.0
1.15k stars 122 forks source link

BoxView becomes invisible after updating Fabulous.XamarinForms v0.53 -> v0.54 #734

Closed Happypig375 closed 4 years ago

Happypig375 commented 4 years ago
namespace ButtonPressFeedback

open System.Diagnostics
open Fabulous
open Fabulous.XamarinForms
open Fabulous.XamarinForms.LiveUpdate
open Xamarin.Forms

module App = 
    let init () = true, Cmd.none
    let update () model =
        not model, Cmd.none
    let view model dispatch =
        View.ContentPage(View.AbsoluteLayout([
            if model then
                View.Button("Switch", dispatch) |> layoutBounds(Rectangle(0., 0., 0.5, 1.)) |> layoutFlags AbsoluteLayoutFlags.All
                View.BoxView(Color.Red) |> layoutBounds(Rectangle(1., 0., 0.5, 1.)) |> layoutFlags AbsoluteLayoutFlags.All
            else
                View.Button("Switch", dispatch) |> layoutBounds(Rectangle(0., 0., 0.5, 1.)) |> layoutFlags AbsoluteLayoutFlags.All
                View.BoxView(Color.Blue) |> layoutBounds(Rectangle(1., 0., 0.5, 1.)) |> layoutFlags AbsoluteLayoutFlags.All
        ]))

    // Note, this declaration is needed if you enable LiveUpdate
    let program = Program.mkProgram init update view

type App () as app = 
    inherit Application ()
    do App.program |> XamarinFormsProgram.run app |> ignore

v0.53: image

v0.54: image

TimLariviere commented 4 years ago

@Happypig375 This appears to be an issue specific to UWP in Xamarin.Forms 4.6. It works correctly on all other platforms, and it was working with Xamarin.Forms 4.5.

I reproduced it in C# (works with XF 4.5, doesn't in XF 4.6).

Repro-CSharp-BoxView-XF46.zip

I would recommend you transfer this issue to Xamarin.Forms.

Happypig375 commented 4 years ago

Hmm. Seems to be fixed already: https://github.com/xamarin/Xamarin.Forms/pull/10540