File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -569,11 +569,16 @@ impl TableView {
569569 FilterState :: Filtering | FilterState :: Filtered => {
570570 self . filter_input . reset ( ) ;
571571 self . filter_state = FilterState :: None ;
572- let orig_idx = self . view_indices [ self . table_state . selected_row ] ;
572+ let orig_idx = self
573+ . view_indices
574+ . get ( self . table_state . selected_row )
575+ . cloned ( ) ;
573576 let before_offset_idx = self . table_state . selected_row_offset_index ( ) ;
574577 self . filter_view_indices ( ) ;
575- self . table_state . select_index ( orig_idx, before_offset_idx) ;
576- self . table_state . update_table_state ( ) ;
578+ if let Some ( orig_idx) = orig_idx {
579+ self . table_state . select_index ( orig_idx, before_offset_idx) ;
580+ self . table_state . update_table_state ( ) ;
581+ }
577582 self . tx . send ( AppEvent :: ClearStatus ) ;
578583 }
579584 FilterState :: None => { }
You can’t perform that action at this time.
0 commit comments