The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

434429 (3) [Avatar] Offline
#1
I just finished the 3d chapter and I noticed that the first time we run the PhotoGroove the selected size is Small whereas the initModel has Medium.

viewSizeChooser : ThumbnailSize -> Html Msg
viewSizeChooser size =
    label []
        [ input [ type_ "radio", name "size" ] []
        , text (sizeToString size)
        ]


I suggest you either to initialize it as Small or to implement the initialization like:

viewSizeChooser : ThumbnailSize -> ThumbnailSize -> Html Msg
viewSizeChooser current size =
  -- ...
      , checked (size == current)
  -- ...

view model =
  -- ...
  ( List.map (viewSizeChooser model.chosenSize) [ Small, Medium, Large ] )


Here there's my repo with a diff https://github.com/pietro909/learning-elm/commit/0b793a2c4d8450a96b4acd7a29be29d62da5ee70

Thank you for this book, it's amazing!