Skip to content

Commit

Permalink
Do not pass events to selectList children when they are not visible (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fjvallarino committed Nov 21, 2022
1 parent ff4ad25 commit df6ae02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Monomer/Widgets/Containers/SelectList.hs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ makeSelectList widgetData items makeRow config state = widget where
| btn == wenv ^. L.mainButton -> result where
result = Just $ resultReqs node [SetFocus (node ^. L.info . L.widgetId)]

Click point _ _
| outsideVp point -> Just ignoreEvtResult

Move point
| outsideVp point -> Just ignoreEvtResult

Focus prev -> handleFocusChange node prev (_slcOnFocusReq config)

Blur next -> result where
Expand All @@ -363,6 +369,10 @@ makeSelectList widgetData items makeRow config state = widget where
isSelectKey code = isKeyReturn code || isKeySpace code
_ -> Nothing

where
outsideVp point = not (pointInRect point (wenv ^. L.viewport))
ignoreEvtResult = resultReqs node [IgnoreChildrenEvents]

highlightNext wenv node = highlightItem wenv node nextIdx where
tempIdx = _hlIdx state
nextIdx
Expand Down

0 comments on commit df6ae02

Please sign in to comment.