on develop help sign in
Fix #72
fa282cfRyan Trinkle
src/Reflex/Dom/Builder/Class.hs+1−1
@@ -135,7 +135,7 @@ instance Reflex t => Default (PlaceholderConfig above t m) where
135
135
136data Placeholder above t
136data Placeholder above t
137 = Placeholder { _placeholder_insertedAbove :: Event t above
137 = Placeholder { _placeholder_insertedAbove :: Event t above
138− , _placeholder_deleted :: Event t ()
138+ , _placeholder_deletedSelf :: Event t ()
139 }
139 }
140
140
141data InputElementConfig er t m
141data InputElementConfig er t m
src/Reflex/Dom/PostBuild/Class.hs+1−1
@@ -48,7 +48,7 @@ instance (DomBuilder t m, PerformEvent t m, MonadFix m, MonadHold t m) => DomBui
48 element t cfg child = liftWith $ \run -> element t (liftPostBuildTElementConfig cfg) $ run child
48 element t cfg child = liftWith $ \run -> element t (liftPostBuildTElementConfig cfg) $ run child
49 {-# INLINABLE placeholder #-}
49 {-# INLINABLE placeholder #-}
50 placeholder cfg = lift $ do
50 placeholder cfg = lift $ do
51− rec childPostBuild <- deletable (cfg ^. deleteSelf) $ performEvent $ return () <$ _placeholder_insertedAbove p
51+ rec childPostBuild <- deletable (_placeholder_deletedSelf p) $ performEvent $ return () <$ _placeholder_insertedAbove p
52 p <- placeholder $ cfg
52 p <- placeholder $ cfg
53 { _placeholderConfig_insertAbove = fmap (\a -> runPostBuildT a =<< headE childPostBuild) $ _placeholderConfig_insertAbove cfg
53 { _placeholderConfig_insertAbove = fmap (\a -> runPostBuildT a =<< headE childPostBuild) $ _placeholderConfig_insertAbove cfg
54 }
54 }
src/Reflex/Dom/Widget/Basic.hs+1−1
@@ -65,7 +65,7 @@ listHoldWithKey initialChildren modifyChildren buildChild = do
65 & deleteSelf .~ delete
65 & deleteSelf .~ delete
66 ph <- placeholder myCfg
66 ph <- placeholder myCfg
67 result <- deletable delete $ buildChild k v
67 result <- deletable delete $ buildChild k v
68− return $ ChildResult (result, (fmap (fmap Just) $ _placeholder_insertedAbove ph) <> (Map.singleton k Nothing <$ _placeholder_deleted ph)) --Note: we could also use the "deleted" output on deletable, if it had one; we're using this so that everything changes all at once, instead of deletions being prompt and insertions being delayed
68+ return $ ChildResult (result, (fmap (fmap Just) $ _placeholder_insertedAbove ph) <> (Map.singleton k Nothing <$ _placeholder_deletedSelf ph)) --Note: we could also use the "deleted" output on deletable, if it had one; we're using this so that everything changes all at once, instead of deletions being prompt and insertions being delayed
69 rec initialAugmentedResults <- iforM initialChildren buildAugmentedChild
69 rec initialAugmentedResults <- iforM initialChildren buildAugmentedChild
70 augmentedResults <- foldDyn applyMap initialAugmentedResults $ newInsertedBelow <> newInsertedAbove
70 augmentedResults <- foldDyn applyMap initialAugmentedResults $ newInsertedBelow <> newInsertedAbove
71 let newInsertedAbove = switch $ fmap (mconcat . reverse . fmap (snd . unChildResult) . Map.elems) $ current augmentedResults
71 let newInsertedAbove = switch $ fmap (mconcat . reverse . fmap (snd . unChildResult) . Map.elems) $ current augmentedResults