fix: ui: accounts: don't let j or C-n move past bottom
This commit is contained in:
		
							parent
							
								
									9f6595f122
								
							
						
					
					
						commit
						7bbff6a359
					
				| @ -332,9 +332,8 @@ asHandle ui0@UIState{ | |||||||
|           asEnterRegister d clickedacct ui |           asEnterRegister d clickedacct ui | ||||||
|           where clickedacct = maybe "" asItemAccountName $ listElements _asList !? y |           where clickedacct = maybe "" asItemAccountName $ listElements _asList !? y | ||||||
| 
 | 
 | ||||||
|         -- prevent moving down over blank padding items; |         -- when selection is at the last item, DOWN scrolls instead of moving, until maximally scrolled | ||||||
|         -- instead scroll down by one, until maximally scrolled - shows the end has been reached |         VtyEvent e | e `elem` moveDownEvents, isBlankElement mnextelement -> do | ||||||
|         VtyEvent (EvKey (KDown)     []) | isBlankElement mnextelement -> do |  | ||||||
|           vScrollBy (viewportScroll $ _asList^.listNameL) 1 >> continue ui |           vScrollBy (viewportScroll $ _asList^.listNameL) 1 >> continue ui | ||||||
|           where mnextelement = listSelectedElement $ listMoveDown _asList |           where mnextelement = listSelectedElement $ listMoveDown _asList | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -372,7 +372,7 @@ rsHandle ui@UIState{ | |||||||
|           continue $ screenEnter d transactionScreen{tsAccount=rsAccount} ui |           continue $ screenEnter d transactionScreen{tsAccount=rsAccount} ui | ||||||
|           where clickeddate = maybe "" rsItemDate $ listElements rsList !? y |           where clickeddate = maybe "" rsItemDate $ listElements rsList !? y | ||||||
| 
 | 
 | ||||||
|         -- when at the last item, instead of moving down, scroll down by one, until maximally scrolled |         -- when selection is at the last item, DOWN scrolls instead of moving, until maximally scrolled | ||||||
|         VtyEvent e | e `elem` moveDownEvents, isBlankElement mnextelement -> do |         VtyEvent e | e `elem` moveDownEvents, isBlankElement mnextelement -> do | ||||||
|           vScrollBy (viewportScroll $ rsList ^. listNameL) 1 >> continue ui |           vScrollBy (viewportScroll $ rsList ^. listNameL) 1 >> continue ui | ||||||
|           where mnextelement = listSelectedElement $ listMoveDown rsList |           where mnextelement = listSelectedElement $ listMoveDown rsList | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user