Skip to content

Commit

Permalink
feat(example-app.vcs): Make the whole vcs toolwindow focusable
Browse files Browse the repository at this point in the history
so that the focus is not force kept on focusable children like the input or tree views.
  • Loading branch information
alirezamirian committed Jan 30, 2024
1 parent e51f367 commit e2ecd30
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const StyledToolWindowHeader = styled.span`
const StyledContainer = styled.div`
height: 100%;
display: flex;
:focus-visible {
outline: none;
}
`;

export const searchInputRefState = atom<RefObject<HTMLInputElement>>({
Expand Down Expand Up @@ -140,7 +143,9 @@ function VcsTab({ tabKey }: { tabKey: string }) {
return (
<ActionsProvider actions={actions}>
{({ shortcutHandlerProps }) => (
<StyledContainer {...shortcutHandlerProps}>
// tabIndex is added to make the whole container focusable, which means the focus can go away from the currently
// focused element, when background is clicked. This is to follow the original implementation.
<StyledContainer {...shortcutHandlerProps} tabIndex={0}>
{!showBranches && (
<ShowBranchesButton onPress={() => setShowBranches(true)} />
)}
Expand Down

0 comments on commit e2ecd30

Please sign in to comment.