@@ -436,13 +436,7 @@ instance (Reflex t, MonadAdjust t m, MonadIO m, MonadHold t m, PerformEvent t m,
436436 return (result0, result')
437437 traverseDMapWithKeyWithAdjust (f :: forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) (dm0 :: DMap k v) dm' = do
438438 initialEnv <- ImmediateDomBuilderT ask
439− let drawChildUpdate :: forall a. ImmediateDomBuilderT t m (v' a) -> m (Compose ((,,) DOM.DocumentFragment DOM.Text) v' a)
440− drawChildUpdate child = do
441− Just df <- createDocumentFragment $ _immediateDomBuilderEnv_document initialEnv
442− runImmediateDomBuilderT (Compose <$> ((,,) <$> pure df <*> textNodeInternal ("" :: Text) <*> child)) $ initialEnv
443− { _immediateDomBuilderEnv_parent = toNode df
444− }
445− (children0, children') <- lift $ traverseDMapWithKeyWithAdjust (\k v -> drawChildUpdate $ f k v) dm0 dm'
439+ (children0, children') <- lift $ traverseDMapWithKeyWithAdjust (\k v -> drawChildUpdate initialEnv $ f k v) dm0 dm'
446440 let result0 = DMap.map (\(Compose (_, _, v)) -> v) children0
447441 placeholders0 = weakenDMapWith (\(Compose (_, ph, _)) -> ph) children0
448442 result' = ffor children' $ mapPatchDMap $ \(Compose (_, _, r)) -> r
@@ -462,13 +456,7 @@ instance (Reflex t, MonadAdjust t m, MonadIO m, MonadHold t m, PerformEvent t m,
462456 return (result0, result')
463457 traverseDMapWithKeyWithAdjustWithMove (f :: forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) (dm0 :: DMap k v) dm' = do
464458 initialEnv <- ImmediateDomBuilderT ask
465− let drawChildUpdate :: forall a. ImmediateDomBuilderT t m (v' a) -> m (Compose ((,,) DOM.DocumentFragment DOM.Text) v' a)
466− drawChildUpdate child = do
467− Just df <- createDocumentFragment $ _immediateDomBuilderEnv_document initialEnv
468− runImmediateDomBuilderT (Compose <$> ((,,) <$> pure df <*> textNodeInternal ("" :: Text) <*> child)) $ initialEnv
469− { _immediateDomBuilderEnv_parent = toNode df
470− }
471− (children0, children') <- lift $ traverseDMapWithKeyWithAdjustWithMove (\k v -> drawChildUpdate $ f k v) dm0 dm'
459+ (children0, children') <- lift $ traverseDMapWithKeyWithAdjustWithMove (\k v -> drawChildUpdate initialEnv $ f k v) dm0 dm'
472460 let result0 = DMap.map (\(Compose (_, _, v)) -> v) children0
473461 placeholders0 = weakenDMapWith (\(Compose (_, ph, _)) -> ph) children0
474462 result' = ffor children' $ mapPatchDMapWithMove $ \(Compose (_, _, r)) -> r
@@ -508,6 +496,11 @@ instance (Reflex t, MonadAdjust t m, MonadIO m, MonadHold t m, PerformEvent t m,
508496 return ()
509497 return (result0, result')
510498
499+drawChildUpdate :: MonadIO m => ImmediateDomBuilderEnv t -> ImmediateDomBuilderT t m (v' a) -> m (Compose ((,,) DOM.DocumentFragment DOM.Text) v' a)
500+drawChildUpdate initialEnv child = do
501+ Just df <- createDocumentFragment $ _immediateDomBuilderEnv_document initialEnv
502+ runImmediateDomBuilderT (Compose <$> ((,,) <$> pure df <*> textNodeInternal ("" :: Text) <*> child)) $ initialEnv { _immediateDomBuilderEnv_parent = toNode df }
503+
511504mkHasFocus :: (MonadHold t m, Reflex t) => Element er d t -> m (Dynamic t Bool)
512505mkHasFocus e = do
513506 let initialFocus = False --TODO: Actually get the initial focus of the element