We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
--debug
The following code works fine when compiled without --debug, but once it's compiled with --debug, clicking either of the links does nothing.
module Main exposing (main) import Browser exposing (Document) import Browser.Navigation as Nav import Html exposing (a, li, text, ul) import Html.Attributes exposing (href) import Time import Url exposing (Url) type alias Model = { navKey : Nav.Key , url : Url } init : () -> Url -> Nav.Key -> ( Model, Cmd Msg ) init flags url navKey = ( { url = url, navKey = navKey } , Cmd.none ) view : Model -> Document Msg view model = { title = "SSCCE" , body = [ text ("I think the current url is " ++ Url.toString model.url) , ul [] [ li [] [ a [ href "#foo" ] [ text "#foo" ] ] , li [] [ a [ href "#bar" ] [ text "#bar" ] ] ] ] } type Msg = LinkClicked Browser.UrlRequest | UrlChanged Url update : Msg -> Model -> ( Model, Cmd Msg ) update msg model = case msg of LinkClicked (Browser.Internal url) -> ( model , Nav.pushUrl model.navKey (Url.toString url) ) LinkClicked (Browser.External href) -> ( model , Nav.load href ) UrlChanged url -> ( { model | url = url }, Cmd.none ) main : Program () Model Msg main = Browser.application { init = init , onUrlChange = UrlChanged , onUrlRequest = LinkClicked , subscriptions = \_ -> Sub.none , update = update , view = view }
The text was updated successfully, but these errors were encountered:
4106168
No branches or pull requests
The following code works fine when compiled without
--debug
, but once it's compiled with--debug
, clicking either of the links does nothing.SSCCE
The text was updated successfully, but these errors were encountered: