@@ -213,7 +213,7 @@ stopPropagation = mempty { _eventFlags_propagation = Propagation_Stop }
213213data ElementConfig er t m
214214 = ElementConfig { _elementConfig_namespace :: Maybe Namespace
215215 , _elementConfig_initialAttributes :: Map AttributeName Text
216− , _elementConfig_modifyAttributes :: Event t (Map AttributeName (Maybe Text))
216+ , _elementConfig_modifyAttributes :: Maybe (Event t (Map AttributeName (Maybe Text)))
217217 , _elementConfig_eventSpec :: EventSpec (DomBuilderSpace m) er
218218 }
219219
@@ -297,13 +297,13 @@ extractRawElementConfig cfg = RawElementConfig
297297 }
298298
299299data RawElementConfig er t m = RawElementConfig
300− { _rawElementConfig_modifyAttributes :: Event t (Map AttributeName (Maybe Text))
300+ { _rawElementConfig_modifyAttributes :: Maybe (Event t (Map AttributeName (Maybe Text)))
301301 , _rawElementConfig_eventSpec :: EventSpec (DomBuilderSpace m) er
302302 }
303303
304304instance (Reflex t, DomSpace (DomBuilderSpace m)) => Default (RawElementConfig EventResult t m) where
305305 def = RawElementConfig
306− { _rawElementConfig_modifyAttributes = never
306+ { _rawElementConfig_modifyAttributes = Nothing
307307 , _rawElementConfig_eventSpec = def
308308 }
309309
@@ -328,8 +328,12 @@ data SelectElement er d t = SelectElement
328328 , _selectElement_raw :: RawSelectElement d
329329 }
330330
331−makeLensesWithoutField "_textNodeConfig_setContents" ''TextNodeConfig
332−makeLensesWithoutField "_inputElementConfig_setValue" ''InputElementConfig
331+concat <$> mapM (uncurry makeLensesWithoutField)
332+ [ ("_textNodeConfig_setContents", ''TextNodeConfig)
333+ , ("_inputElementConfig_setValue", ''InputElementConfig)
334+ , ("_rawElementConfig_modifyAttributes", ''RawElementConfig)
335+ , ("_elementConfig_modifyAttributes", ''ElementConfig)
336+ ]
333337
334338-- | This lens is technically illegal. The implementation of 'TextNodeConfig' uses a 'Maybe' under the hood for efficiency reasons. However, always interacting with 'TextNodeConfig' via lenses will always behave correctly, and if you pattern match on it, you should always treat 'Nothing' as 'never'.
335339textNodeConfig_setContents :: Reflex t => Lens (TextNodeConfig t) (TextNodeConfig t) (Event t Text) (Event t Text)
@@ -349,12 +353,28 @@ inputElementConfig_setValue =
349353 setter t e = t { _inputElementConfig_setValue = Just e }
350354 in lens getter setter
351355
356+-- | This lens is technically illegal. The implementation of 'RawElementConfig' uses a 'Maybe' under the hood for efficiency reasons. However, always interacting with 'RawElementConfig' via lenses will always behave correctly, and if you pattern match on it, you should always treat 'Nothing' as 'never'.
357+rawElementConfig_modifyAttributes :: Reflex t => Lens (RawElementConfig er t m) (RawElementConfig er t m) (Event t (Map AttributeName (Maybe Text))) (Event t (Map AttributeName (Maybe Text)))
358+rawElementConfig_modifyAttributes =
359+ let getter t = case _rawElementConfig_modifyAttributes t of
360+ Nothing -> never
361+ Just e -> e
362+ setter t e = t { _rawElementConfig_modifyAttributes = Just e }
363+ in lens getter setter
364+
365+-- | This lens is technically illegal. The implementation of 'RawElementConfig' uses a 'Maybe' under the hood for efficiency reasons. However, always interacting with 'RawElementConfig' via lenses will always behave correctly, and if you pattern match on it, you should always treat 'Nothing' as 'never'.
366+elementConfig_modifyAttributes :: Reflex t => Lens (ElementConfig er t m) (ElementConfig er t m) (Event t (Map AttributeName (Maybe Text))) (Event t (Map AttributeName (Maybe Text)))
367+elementConfig_modifyAttributes =
368+ let getter t = case _elementConfig_modifyAttributes t of
369+ Nothing -> never
370+ Just e -> e
371+ setter t e = t { _elementConfig_modifyAttributes = Just e }
372+ in lens getter setter
373+
352374concat <$> mapM makeLenses
353− [ ''ElementConfig
354− , ''PlaceholderConfig
375+ [ ''PlaceholderConfig
355376 , ''TextAreaElementConfig
356377 , ''SelectElementConfig
357− , ''RawElementConfig
358378 ]
359379
360380class CanDeleteSelf t a | a -> t where
@@ -390,7 +410,7 @@ instance InitialAttributes (SelectElementConfig er t m) where
390410 initialAttributes = selectElementConfig_elementConfig . elementConfig_initialAttributes
391411
392412class ModifyAttributes t a | a -> t where
393− modifyAttributes :: Lens' a (Event t (Map AttributeName (Maybe Text)))
413+ modifyAttributes :: Reflex t => Lens' a (Event t (Map AttributeName (Maybe Text)))
394414
395415instance ModifyAttributes t (ElementConfig er t m) where
396416 {-# INLINABLE modifyAttributes #-}
@@ -424,7 +444,7 @@ instance (Reflex t, er ~ EventResult, DomBuilder t m) => Default (ElementConfig
424444 def = ElementConfig
425445 { _elementConfig_namespace = Nothing
426446 , _elementConfig_initialAttributes = mempty
427− , _elementConfig_modifyAttributes = never
447+ , _elementConfig_modifyAttributes = Nothing
428448 , _elementConfig_eventSpec = def
429449 }
430450