on develop help sign in
Don't attempt to add child node to dyn when placeholder parent can't be found
c6ee1e7Ali Abrar
src/Reflex/Dom/Widget/Basic.hs+2−2
@@ -122,8 +122,8 @@ dyn child = do
122 (result, postBuild, voidActions) <- runWidget df c
122 (result, postBuild, voidActions) <- runWidget df c
123 scheduleFollowup newChildBuiltTriggerRef (result, voidActions)
123 scheduleFollowup newChildBuiltTriggerRef (result, voidActions)
124 postBuild
124 postBuild
125− Just p <- liftIO $ nodeGetParentNode endPlaceholder
125+ mp <- liftIO $ nodeGetParentNode endPlaceholder
126− _ <- liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
126+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
127 return ()
127 return ()
128 schedulePostBuild $ do
128 schedulePostBuild $ do
129 c <- sample $ current child
129 c <- sample $ current child