Sitelet https://github.com/purescript-halogen/purescript-halogen/issues/780
Skip to content

HTML elements styled only after the first click #780

Description

@ocramz

I'm trying to style the Button component from the template project ( https://github.com/purescript-halogen/purescript-halogen-template/blob/master/src/App/Button.purs ) with some Bulma CSS (loaded in the html head from the CDN), as in the snippet below.

I noticed that the button element only gets a style after the first click, instead of on page load as I was hoping.

Screen-Recording-2021-12-25-at-22 04 24

Am I doing something wrong here? If so, how to fix?
Thank you in advance

render :: forall cs m. State -> ComponentHTML Action cs m
render state =
  div [ bSection
      ]
    [ p_
        [ text $ "You clicked " <> show state.count <> " times" ]
    , button
        [ cl_ "button"
        , onClick \_ -> Increment
        ]
        [ text "Click me" ]
    ]

cl_ n = class_ (ClassName n)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions