File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed 
packages/pluggableWidgets/datagrid-web/src/helpers/state Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -85,17 +85,12 @@ export class SelectAllBarViewModel implements ReactiveController {
8585        return  str . replace ( "%d" ,  `${ this . #count. selectedCount }  ` ) ; 
8686    } 
8787
88-     private  get  selectedSet ( ) : Set < string >  { 
89-         const  selection  =  this . #gate. props . itemSelection ; 
90-         if  ( ! selection )  return  new  Set ( ) ; 
91-         if  ( selection . type  ===  "Single" )  return  new  Set ( ) ; 
92-         return  new  Set ( [ ...selection . selection . map ( it  =>  it . id ) ] ) ; 
93-     } 
94- 
9588    private  get  isCurrentPageSelected ( ) : boolean  { 
96-         const  items  =  this . #gate. props . datasource . items  ??  [ ] ; 
97-         if  ( items . length  ===  0 )  return  false ; 
98-         return  items . every ( items  =>  this . selectedSet . has ( items . id ) ) ; 
89+         const  selection  =  this . #gate. props . itemSelection ; 
90+         if  ( ! selection  ||  selection . type  ===  "Single" )  return  false ; 
91+         const  pageIds  =  new  Set ( this . #gate. props . datasource . items ?. map ( item  =>  item . id )  ??  [ ] ) ; 
92+         const  selectionSubArray  =  selection . selection . filter ( item  =>  pageIds . has ( item . id ) ) ; 
93+         return  selectionSubArray . length  ===  pageIds . size  &&  pageIds . size  >  0 ; 
9994    } 
10095
10196    private  get  isAllItemsSelected ( ) : boolean  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments