@@ -53,7 +53,7 @@ import Reflex.TriggerEvent.Class
54data StaticDomBuilderEnv t = StaticDomBuilderEnv
54data StaticDomBuilderEnv t = StaticDomBuilderEnv
55 { _staticDomBuilderEnv_shouldEscape :: Bool
55 { _staticDomBuilderEnv_shouldEscape :: Bool
56− , _staticDomBuilderEnv_selectValue :: Maybe (Dynamic t Text)
56+ , _staticDomBuilderEnv_selectValue :: Maybe (Behavior t Text)
59newtype StaticDomBuilderT t m a = StaticDomBuilderT
59newtype StaticDomBuilderT t m a = StaticDomBuilderT
@@ -192,9 +192,9 @@ instance SupportsStaticDomBuilder t m => DomBuilder t (StaticDomBuilderT t m) wh
192 Just v | v == sel -> attrs <> Map.singleton "selected" ""
192 Just v | v == sel -> attrs <> Map.singleton "selected" ""
193 _ -> Map.delete "selected" attrs
193 _ -> Map.delete "selected" attrs
194 let attrs1 = case selectValue of
194 let attrs1 = case selectValue of
195− Nothing -> attrs0
195+ Nothing -> current attrs0
196− Just sv -> zipDynWith addSelectedAttr attrs0 sv
196+ Just sv -> pull $ addSelectedAttr <$> sample (current attrs0) <*> sample sv
197− let attrs2 = ffor (current attrs1) $ mconcat . fmap (\(k, v) -> " " <> toAttr k v) . Map.toList
197+ let attrs2 = ffor attrs1 $ mconcat . fmap (\(k, v) -> " " <> toAttr k v) . Map.toList
198 let tagBS = encodeUtf8 elementTag
198 let tagBS = encodeUtf8 elementTag
199 if Set.member elementTag voidElements
199 if Set.member elementTag voidElements
200 then modify $ (:) $ mconcat [constant ("<" <> byteString tagBS), attrs2, constant (byteString " />")]
200 then modify $ (:) $ mconcat [constant ("<" <> byteString tagBS), attrs2, constant (byteString " />")]
@@ -235,7 +235,7 @@ instance SupportsStaticDomBuilder t m => DomBuilder t (StaticDomBuilderT t m) wh
235 selectElement cfg child = do
235 selectElement cfg child = do
236 v <- holdDyn (cfg ^. selectElementConfig_initialValue) (cfg ^. selectElementConfig_setValue)
236 v <- holdDyn (cfg ^. selectElementConfig_initialValue) (cfg ^. selectElementConfig_setValue)
237 (e, result) <- element "select" (_selectElementConfig_elementConfig cfg) $ do
237 (e, result) <- element "select" (_selectElementConfig_elementConfig cfg) $ do
238− (a, innerHtml) <- StaticDomBuilderT $ lift $ lift $ runStaticDomBuilderT child $ StaticDomBuilderEnv False (Just v)
238+ (a, innerHtml) <- StaticDomBuilderT $ lift $ lift $ runStaticDomBuilderT child $ StaticDomBuilderEnv False $ Just (current v)
239 StaticDomBuilderT $ lift $ modify $ (:) innerHtml
239 StaticDomBuilderT $ lift $ modify $ (:) innerHtml
241 let wrapped = SelectElement
241 let wrapped = SelectElement