on develop help sign in
input: Fix inputInFocusedRegion so that clicked node can _gain_ focus
cf82eecAli Abrar
src/Reflex/Vty/Widget.hs+6−2
@@ -206,8 +206,12 @@ inputInFocusedRegion
206inputInFocusedRegion = do
206inputInFocusedRegion = do
207 inp <- input
207 inp <- input
208 reg <- current <$> askRegion
208 reg <- current <$> askRegion
209− f <- current <$> focus
209+ foc <- current <$> focus
210− pure $ gate f $ fmapMaybe id $ attachWith mouseInRegion reg inp
210+ pure $ fmapMaybe id $ attachWith filterInput ((,) <$> reg <*> foc) inp
211+ where
212+ filterInput (r, f) = \case
213+ V.EvKey {} | not f -> Nothing
214+ x -> mouseInRegion r x
211
215
212-- * Getting and setting the display region
216-- * Getting and setting the display region
213
217