@@ -742,8 +742,11 @@ hoistTraverseWithKeyWithAdjust base mapPatch updateChildUnreadiness applyDomUpda
742742 haveEverBeenReady <- liftIO $ newIORef False
743743 placeholders <- liftIO $ newIORef $ error "placeholders not yet initialized"
744744 lastPlaceholderRef <- liftIO $ newIORef $ error "lastPlaceholderRef not yet initialized"
745− let applyDomUpdate = applyDomUpdate_ placeholders lastPlaceholderRef
746− let markSelfReady = do
745+ let applyDomUpdate p = do
746+ applyDomUpdate_ placeholders lastPlaceholderRef p
747+ markSelfReady
748+ liftIO $ writeIORef pendingChange $! mempty
749+ markSelfReady = do
747750 liftIO (readIORef haveEverBeenReady) >>= \case
748751 True -> return ()
749752 False -> do
@@ -767,7 +770,6 @@ hoistTraverseWithKeyWithAdjust base mapPatch updateChildUnreadiness applyDomUpda
767770 liftIO $ writeIORef pendingChange (newUnready, p)
768771 when (DMap.null newUnready) $ do
769772 applyDomUpdate p
770− markSelfReady
771773 (children0, children') <- ImmediateDomBuilderT $ lift $ base (\k v -> drawChildUpdate initialEnv markChildReady $ f k v) dm0 dm'
772774 let processChild k (Compose (_, _, sRef, _)) = ComposeMaybe <$> do
773775 readIORef sRef >>= \case
@@ -787,7 +789,6 @@ hoistTraverseWithKeyWithAdjust base mapPatch updateChildUnreadiness applyDomUpda
787789 liftIO $ writeIORef placeholders $! placeholders0
788790 _ <- DMap.traverseWithKey (\_ (Compose (df, _, _, _)) -> Constant () <$ append df) children0
789791 liftIO . writeIORef lastPlaceholderRef =<< textNodeInternal ("" :: Text)
790− -- Note: the numbering here must match the numbering of dm''
791792 requestDomAction_ $ ffor children' $ \p -> do
792793 (oldUnready, oldP) <- liftIO $ readIORef pendingChange
793794 newUnready <- liftIO $ updateChildUnreadiness p oldUnready
@@ -795,8 +796,6 @@ hoistTraverseWithKeyWithAdjust base mapPatch updateChildUnreadiness applyDomUpda
795796 liftIO $ writeIORef pendingChange (newUnready, newP)
796797 when (DMap.null newUnready) $ do
797798 applyDomUpdate newP
798− markSelfReady
799− liftIO $ writeIORef pendingChange $! mempty
800799 return (result0, result')
801800
802801drawChildUpdate :: (MonadIO m, MonadJSM m)