on develop help sign in
Add minor workaround
2e78473Ryan Trinkle
src/Reflex/Dom/Widget/Basic.hs+2−1
@@ -129,9 +129,10 @@ dyn child = do
129widgetHold :: MonadWidget t m => m a -> Event t (m a) -> m (Dynamic t a)
129widgetHold :: MonadWidget t m => m a -> Event t (m a) -> m (Dynamic t a)
130widgetHold child0 newChild = do
130widgetHold child0 newChild = do
131 startPlaceholder <- text' ""
131 startPlaceholder <- text' ""
132− result0 <- child0
132+ result0 <- child0 -- I'm pretty sure this is wrong; the void actions should get removed when the child is swapped out
133 endPlaceholder <- text' ""
133 endPlaceholder <- text' ""
134 (newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
134 (newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
135+ performEvent_ $ fmap (const $ return ()) newChildBuilt --TODO: Get rid of this hack
135 childVoidAction <- hold never $ fmap snd newChildBuilt
136 childVoidAction <- hold never $ fmap snd newChildBuilt
136 addVoidAction $ switch childVoidAction
137 addVoidAction $ switch childVoidAction
137 doc <- askDocument
138 doc <- askDocument