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

Event handler removal fails. #6

Open
cliffordbeshers opened this issue Apr 4, 2015 · 1 comment
Open

Event handler removal fails. #6

cliffordbeshers opened this issue Apr 4, 2015 · 1 comment

Comments

@cliffordbeshers
Copy link
Contributor

The following program should do nothing when the text is clicked, but the Ugh message appears anyway.

{-# LANGUAGE OverloadedStrings #-}

import Control.Monad (void)
import Data.Default
import Data.Text (Text)
import JavaScript.JQuery

default (Text)

main = do
body <- select "body"
button <- select "

Should do nothing when clicked.
"
response <- select "
Ugh, it did something.
"
appendJQuery button body
detach <- click (\e -> void $ appendJQuery response body) def button
detach
return ()

@cliffordbeshers
Copy link
Contributor Author

N.B. If I open the javascript console in the browser and run $().off on that element, the event handler is removed.

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

1 participant