@@ -189,12 +189,13 @@ data Checkbox t
189189{-# INLINABLE checkbox #-}
190190checkbox :: (DomBuilder t m, PostBuild t m) => Bool -> CheckboxConfig t -> m (Checkbox t)
191191checkbox checked config = do
192− let insertType = Map.insert "type" "checkbox"
193− dAttrs = fmap (Map.delete "checked" . insertType) $ _checkboxConfig_attributes config
192+ let permanentAttrs = "type" =: "checkbox"
193+ dAttrs = fmap (Map.delete "checked" . Map.union permanentAttrs) $ _checkboxConfig_attributes config
194194 modifyAttrs <- dynamicAttributesToModifyAttributes dAttrs
195195 i <- inputElement $ def
196196 & inputElementConfig_initialChecked .~ checked
197197 & inputElementConfig_setChecked .~ _checkboxConfig_setValue config
198+ & inputElementConfig_elementConfig . elementConfig_initialAttributes .~ Map.mapKeys ((,) Nothing) permanentAttrs
198199 & inputElementConfig_elementConfig . elementConfig_modifyAttributes .~ modifyAttrs
199200 return $ Checkbox
200201 { _checkbox_value = _inputElement_checked i
@@ -269,8 +270,8 @@ newtype CheckboxViewEventResult en = CheckboxViewEventResult { unCheckboxViewEve
269270{-# INLINABLE checkboxView #-}
270271checkboxView :: forall t m. (DomBuilder t m, DomBuilderSpace m ~ GhcjsDomSpace, PostBuild t m, MonadHold t m) => Dynamic t (Map Text Text) -> Dynamic t Bool -> m (Event t Bool)
271272checkboxView dAttrs dValue = do
272− let insertType = Map.insert "type" "checkbox"
273− modifyAttrs <- dynamicAttributesToModifyAttributes $ fmap insertType dAttrs
273+ let permanentAttrs = "type" =: "checkbox"
274+ modifyAttrs <- dynamicAttributesToModifyAttributes $ fmap (Map.union permanentAttrs) dAttrs
274275 postBuild <- getPostBuild
275276 let filters :: DMap EventName (EventFilter (DomBuilderSpace m) CheckboxViewEventResult)
276277 filters = DMap.singleton Click $ EventFilter $ GhcjsDomHandler $ \(GhcjsDomEvent evt) -> do
@@ -280,6 +281,7 @@ checkboxView dAttrs dValue = do
280281 elementConfig :: ElementConfig CheckboxViewEventResult t m
281282 elementConfig = (def :: ElementConfig EventResult t m)
282283 { _elementConfig_modifyAttributes = modifyAttrs
284+ , _elementConfig_initialAttributes = Map.mapKeys ((,) Nothing) permanentAttrs
283285 , _elementConfig_eventFilters = filters
284286 , _elementConfig_eventHandler = GhcjsDomHandler1 $ \p@(Pair1 en _) -> case en of
285287 Click -> error "impossible"