on develop help sign in
When trying to add a child node in listViewWithKey', if the placeholder is no longer in the DOM, do nothing
commit459558a1e467f1d9ffab411ab57d91cd8ece7ca3 authorRyan Trinkle <ryan.trinkle@gmail.com> dateMon 10 Aug 2015, 20:21 (11 years ago) parent242cba3
1 file changed+2−2
src/Reflex/Dom/Widget/Basic.hs+2−2
src/Reflex/Dom/Widget/Basic.hs+2−2
@@ -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) --TODO: Should this really be ignored if mp is Nothing, or should we ensure that mp is never Nothing
315315 return $ Just s
316316 These state _ -> do
317317 return $ Just state