@@ -209,8 +209,8 @@ listHoldWithKey initialVals valsChanged mkChild = do
209209 stateRef <- liftIO $ newIORef initialState
210210 children <- holdDyn initialState newChildren
211211 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) $ current children
212− Just pOrig <- liftIO $ nodeGetParentNode endPlaceholder
213− _ <- liftIO $ nodeInsertBefore pOrig (Just dfOrig) (Just endPlaceholder)
212+ mpOrig <- liftIO $ nodeGetParentNode endPlaceholder
213+ forM_ mpOrig $ \pOrig -> liftIO $ nodeInsertBefore pOrig (Just dfOrig) (Just endPlaceholder)
214214 addVoidAction $ flip fmap valsChanged $ \newVals -> do
215215 curState <- liftIO $ readIORef stateRef
216216 --TODO: Should we remove the parent from the DOM first to avoid reflows?
@@ -224,8 +224,8 @@ listHoldWithKey initialVals valsChanged mkChild = do
224224 (childResult, childPostBuild, childVoidAction) <- lift $ buildChild df k v
225225 let s = (childResult, childVoidAction)
226226 modify (>>childPostBuild)
227− Just p <- liftIO $ nodeGetParentNode end
228− _ <- liftIO $ nodeInsertBefore p (Just df) (Just end)
227+ mp <- liftIO $ nodeGetParentNode end
228+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just end)
229229 return $ Just s
230230 That Nothing -> return Nothing -- Deleting non-existent child
231231 That (Just v) -> do -- Creating new child
@@ -236,8 +236,8 @@ listHoldWithKey initialVals valsChanged mkChild = do
236236 let placeholder = case Map.lookupGT k curState of
237237 Nothing -> endPlaceholder
238238 Just (_, ((_, (start, _)), _)) -> start
239− Just p <- liftIO $ nodeGetParentNode placeholder
240− _ <- liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
239+ mp <- liftIO $ nodeGetParentNode placeholder
240+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
241241 return $ Just s
242242 This state -> do -- No change
243243 return $ Just state