Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabulous.Core.0.32+ TableView deselecting EntryCell & Entry #363

Closed
pauldorehill opened this issue Mar 20, 2019 · 1 comment
Closed

Fabulous.Core.0.32+ TableView deselecting EntryCell & Entry #363

pauldorehill opened this issue Mar 20, 2019 · 1 comment

Comments

@pauldorehill
Copy link

When using a View.TableView with either a View.EntryCell or a View.Entry with Fabulous.Core.0.32 (and above) every time a key is pressed while the EntryCell/Entry is selected the value updates but then the EntryCell/Entry becomes deselected.

I've tested this on UWP/WPF/Android. On Android there is a double effect where you cannot deselect the keyboard unless you first click in the text entry box and then click outside of the box.

This doesn't happen with Fabulous.Core.0.31 and below. I looked in the release notes and maybe something with #325? On a side note on updating my Fabulous.Core from 0.31 -> 0.32 it fixed a separate bug with View.TableView where the section titles were not displaying correctly.

If you could point me in the right direction I am happy to try and help out.

To test here is simple app:

module App =

    type Model = 
        | Page1 of string 
        | Page2 of string 
        member this.Value = match this with | Page1 x | Page2 x -> x
        member this.Update x = match this with | Page1 _ -> Page1 x | Page2 _ -> Page2 x
        member this.Switch = match this with | Page1 x -> Page2 x | Page2 x -> Page1 x

    type Msg = 
        | Update of string
        | Switch

    let init () = Page1 "Kangaroo", Cmd.none

    let update msg (model : Model) = 
        match msg with
        | Update newString -> model.Update newString, Cmd.none
        | Switch -> model.Switch, Cmd.none

    let view model dispatch =
        View.ContentPage(
            content =
                match model with 
                | Page1 _ ->
                    View.TableView(
                        items = [
                            "Cell", [View.EntryCell(label = "Animal", text = model.Value, textChanged = fun str -> dispatch (Update str.NewTextValue))]
                            "Label / Entry", 
                                [ View.ViewCell(view = View.Label(text = "Entry"))
                                  View.ViewCell(view = View.Entry(text = model.Value, textChanged = fun str -> dispatch (Update str.NewTextValue))) ]
                            "Switch", [ View.ViewCell(view = View.Button("Switch to list", command = fun () -> dispatch Switch)) ]
                        ]
                    )
                | Page2 _ ->
                    View.ListView(
                        items = [
                            View.Label(text = "Animal")
                            View.Entry(text = model.Value, textChanged = fun str -> dispatch (Update str.NewTextValue))
                            View.Label(text = "Switch")
                            View.Button("Switch to table", command = fun () -> dispatch Switch)
                        ]
                    )
        )

    let program = Program.mkProgram init update view
@pauldorehill pauldorehill changed the title Fabulous.Core.0.32 (and above) View.TableView deselecting View.EntryCell & View.Entry Fabulous.Core.0.32 (and above) TableView deselecting EntryCell & Entry Mar 20, 2019
@pauldorehill pauldorehill changed the title Fabulous.Core.0.32 (and above) TableView deselecting EntryCell & Entry Fabulous.Core.0.32+TableView deselecting EntryCell & Entry Mar 20, 2019
@pauldorehill pauldorehill changed the title Fabulous.Core.0.32+TableView deselecting EntryCell & Entry Fabulous.Core.0.32+ TableView deselecting EntryCell & Entry Mar 20, 2019
@TimLariviere
Copy link
Member

Your issue should be fixed with #364
I will release a 0.33.2 with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants