File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed 
src/components/ApiDocs/display Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { ParameterType } from './ParameterType';
66import  {  ApiComment  }  from  '../ApiComment' ; 
77import  {  LinkDataType ,  TypeLinkInterface  }  from  './TypeLink' ; 
88import  references  from  '@/directory/apiReferences.json' ; 
9+ import  {  useRef  }  from  'react' ; 
910
1011interface  ApiModalInterface  { 
1112  data : any ; 
@@ -26,6 +27,7 @@ export const ApiModal = ({
2627    data  =  references [ data . target ] ; 
2728  } 
2829  const  description  =  data ?. comment ?. summary ; 
30+   const  ref  =  useRef < HTMLDivElement > ( null ) ; 
2931
3032  const  closeModal  =  ( )  =>  { 
3133    clearBC ( ) ; 
@@ -84,10 +86,18 @@ export const ApiModal = ({
8486      } ,  [ ]  as  TypeLinkInterface [ ] ) 
8587    : [ ] ; 
8688
89+   if  ( showModal )  { 
90+     setTimeout ( ( )  =>  { 
91+       ref ?. current ?. focus ( ) ; 
92+     } ,  0 ) ; 
93+   } 
94+ 
8795  return  ( 
8896    < View 
8997      aria-label = { `${ name }   API Reference` } 
9098      className = { `api-modal-container${ showModal  ? ' api-modal-container--open'  : '' }  ` } 
99+       ref = { ref } 
100+       tabIndex = { 0 } 
91101    > 
92102      < Card  as = "dialog"  className = "api-modal"  aria-modal = "true" > 
93103        < Flex  className = "api-model__header" > 
@@ -97,6 +107,7 @@ export const ApiModal = ({
97107            size = "small" 
98108            variation = "link" 
99109            className = "api-modal__close" 
110+             aria-label = "Close" 
100111          > 
101112            < IconX  /> 
102113          </ Button > 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments