fix: prevent focusing on unwanted div

This commit is contained in:
EnixCoda 2022-08-29 22:38:35 +08:00
parent 9dce33bb50
commit 2e844025a3

View file

@ -198,7 +198,6 @@ function LoadedFileExplorer({
// instead of unmounting, hide the element when not needed, so that the ref can be preserved after search result matches nothing
hidden: visibleNodes.nodes.length === 0,
})}
tabIndex={-1} // prevent getting focus via tab key on GitHub
ref={filesRef}
>
<div
@ -210,6 +209,7 @@ function LoadedFileExplorer({
}}
ref={scrollElementRef}
onScroll={onScroll}
tabIndex={-1} // prevent getting focus via tab key on GitHub
>
<div style={containerStyle}>
{visibleRows.map(({ row, style }) => {