File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
packages/ui-modal/src/Modal/ModalBody Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -113,14 +113,10 @@ class ModalBody extends Component<ModalBodyProps> {
113113 as = { as }
114114 css = { this . props . styles ?. modalBody }
115115 padding = { padding }
116- // Setting this to 0 is necessary for findFocusable to find this DOM
117- // element.
118- // Note that VoiceOver does not read the contents properly
119- // if there is a scrollbar, and it has no kb just SR focus.
120- // To prevent this we could set tabIndex to -1
121- // but this would make the scrollbar non-focusable, so the modal cannot
122- // be scrolled with keyboard.
123- tabIndex = { 0 }
116+ //check if there is a scrollbar, if so, the element has to be tabbable to be able to scroll with keyboard only
117+ { ...( this . ref ?. scrollHeight !== this . ref ?. getBoundingClientRect ( ) . height
118+ ? { tabIndex : 0 }
119+ : { } ) }
124120 >
125121 { children }
126122 </ View >
You can’t perform that action at this time.
0 commit comments