File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/main/src/components/ObjectPageSection Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,13 @@ const ObjectPageSection = forwardRef<HTMLElement, ObjectPageSectionPropTypes>((p
8282 if ( typeof props . onFocus === 'function' ) {
8383 props . onFocus ( e ) ;
8484 }
85+ // reset tab-index of all sections, so only the focused one is tabbable
86+ Array . from ( e . currentTarget . parentElement . children as HTMLCollectionOf < HTMLElement > ) . forEach ( ( el ) => {
87+ if ( el . dataset . componentName === 'ObjectPageSection' ) {
88+ el . tabIndex = - 1 ;
89+ }
90+ } ) ;
91+ e . currentTarget . tabIndex = 0 ;
8592 const hasSubSection = Children . toArray ( children ) . some (
8693 // @ts -expect-error: if type is string, then it's not a subcomponent
8794 ( child ) => isValidElement ( child ) && child . type ?. displayName === 'ObjectPageSubSection' ,
@@ -127,7 +134,9 @@ const ObjectPageSection = forwardRef<HTMLElement, ObjectPageSectionPropTypes>((p
127134 ( target . previousElementSibling as HTMLElement ) . dataset . componentName !== 'ObjectPageSection' ;
128135 // header collapse leads to loose scrolling - this fallback makes sure the second section is marked as selected
129136 if ( isFirstSection ) {
130- target . parentElement . parentElement . scrollBy ( 0 , 14 ) ;
137+ setTimeout ( ( ) => {
138+ target . parentElement . parentElement . scrollBy ( 0 , 14 ) ;
139+ } ) ;
131140 }
132141 } ) ;
133142 }
You can’t perform that action at this time.
0 commit comments