on develop help sign in
Strictly evaluate the input to htmlInputElementSetChecked

See https://github.com/ghcjs/ghcjs/issues/307

commit7032bec202a5e072338f03c17c01377c6acd3e96 authorRyan Trinkle <ryan.trinkle@gmail.com> dateThu 5 Mar 2015, 20:14 (12 years ago) parent33ac899
1 file changed+2−2
src/Reflex/Dom/Widget/Input.hs+2−2
src/Reflex/Dom/Widget/Input.hs+2−2
@@ -188,7 +188,7 @@ checkbox :: MonadWidget t m => Bool -> CheckboxConfig t -> m (Checkbox t)
188188checkbox checked config = do
189189 e <- liftM castToHTMLInputElement $ buildEmptyElement "input" $ Map.insert "type" "checkbox" $ (if checked then Map.insert "checked" "checked" else Map.delete "checked") (_checkboxConfig_attributes config)
190190 eClick <- wrapDomEvent e elementOnclick $ liftIO $ htmlInputElementGetChecked e
191− performEvent_ $ fmap (liftIO . htmlInputElementSetChecked e) $ _checkboxConfig_setValue config
191+ performEvent_ $ fmap (\v -> liftIO $ htmlInputElementSetChecked e $! v) $ _checkboxConfig_setValue config
192192 dValue <- holdDyn checked $ leftmost [_checkboxConfig_setValue config, eClick]
193193 return $ Checkbox dValue
194194
@@ -201,7 +201,7 @@ checkboxView dAttrs dValue = do
201201 schedulePostBuild $ do
202202 v <- sample $ current dValue
203203 when v $ liftIO $ htmlInputElementSetChecked e True
204− performEvent_ $ fmap (\v -> liftIO $ htmlInputElementSetChecked e v) $ updated dValue
204+ performEvent_ $ fmap (\v -> liftIO $ htmlInputElementSetChecked e $! v) $ updated dValue
205205 return eClicked
206206
207207checkboxWithLabel :: forall t m. MonadWidget t m => String -> m (Checkbox t)