@@ -184,8 +184,8 @@ listWithKey vals mkChild = do
184184 return ((result, voidAction), postBuild)
185185 scheduleFollowup newChildrenTriggerRef $ fmap fst initialState --TODO: Do all these in a single runFrame
186186 sequence_ $ fmap snd initialState
187− Just p <- liftIO $ nodeGetParentNode endPlaceholder
188− _ <- liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
187+ mp <- liftIO $ nodeGetParentNode endPlaceholder
188+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
189189 return ()
190190 addVoidAction $ flip fmap (updated vals) $ \newVals -> do
191191 curState <- sample children
@@ -202,8 +202,8 @@ listWithKey vals mkChild = do
202202 let placeholder = case Map.lookupGT k curState of
203203 Nothing -> endPlaceholder
204204 Just (_, ((_, (start, _)), _)) -> start
205− Just p <- liftIO $ nodeGetParentNode placeholder
206− _ <- liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
205+ mp <- liftIO $ nodeGetParentNode placeholder
206+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
207207 return $ Just s
208208 These state _ -> do
209209 return $ Just state
@@ -230,8 +230,8 @@ listWithKey' initialVals valsChanged mkChild = do
230230 initialState <- iforM initialVals $ \k v -> subWidgetWithVoidActions (toNode dfOrig) $ wrapChild k v --Note: we have to use subWidgetWithVoidActions rather than runWidget here, because running post-build actions during build can cause not-yet-constructed values to be read
231231 children <- holdDyn initialState newChildren
232232 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) $ current children
233− Just pOrig <- liftIO $ nodeGetParentNode endPlaceholder
234− _ <- liftIO $ nodeInsertBefore pOrig (Just dfOrig) (Just endPlaceholder)
233+ mpOrig <- liftIO $ nodeGetParentNode endPlaceholder
234+ forM_ mpOrig $ \pOrig -> liftIO $ nodeInsertBefore pOrig (Just dfOrig) (Just endPlaceholder)
235235 addVoidAction $ flip fmap valsChanged $ \newVals -> do
236236 curState <- sample $ current children
237237 --TODO: Should we remove the parent from the DOM first to avoid reflows?
@@ -245,8 +245,8 @@ listWithKey' initialVals valsChanged mkChild = do
245245 (childResult, childPostBuild, childVoidAction) <- lift $ buildChild df k v
246246 let s = (childResult, childVoidAction)
247247 modify (>>childPostBuild)
248− Just p <- liftIO $ nodeGetParentNode end
249− _ <- liftIO $ nodeInsertBefore p (Just df) (Just end)
248+ mp <- liftIO $ nodeGetParentNode end
249+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just end)
250250 return $ Just s
251251 That Nothing -> return Nothing -- Deleting non-existent child
252252 That (Just v) -> do -- Creating new child
@@ -257,8 +257,8 @@ listWithKey' initialVals valsChanged mkChild = do
257257 let placeholder = case Map.lookupGT k curState of
258258 Nothing -> endPlaceholder
259259 Just (_, ((_, (start, _)), _)) -> start
260− Just p <- liftIO $ nodeGetParentNode placeholder
261− _ <- liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
260+ mp <- liftIO $ nodeGetParentNode placeholder
261+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
262262 return $ Just s
263263 This state -> do -- No change
264264 return $ Just state
@@ -292,8 +292,8 @@ listViewWithKey' vals mkChild = do
292292 return ((result, voidAction), postBuild)
293293 scheduleFollowup newChildrenTriggerRef $ fmap fst initialState --TODO: Do all these in a single runFrame
294294 sequence_ $ fmap snd initialState
295− Just p <- liftIO $ nodeGetParentNode endPlaceholder
296− _ <- liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
295+ mp <- liftIO $ nodeGetParentNode endPlaceholder
296+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
297297 return ()
298298 addVoidAction $ flip fmap (updated vals) $ \newVals -> do
299299 curState <- sample children
@@ -310,8 +310,8 @@ listViewWithKey' vals mkChild = do
310310 let placeholder = case Map.lookupGT k curState of
311311 Nothing -> endPlaceholder
312312 Just (_, ((_, (start, _)), _)) -> start
313− Just p <- liftIO $ nodeGetParentNode placeholder
314− _ <- liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
313+ mp <- liftIO $ nodeGetParentNode placeholder
314+ forM_ mp $ \p -> liftIO $ nodeInsertBefore p (Just df) (Just placeholder)
315315 return $ Just s
316316 These state _ -> do
317317 return $ Just state