feat: focus

This commit is contained in:
cha0s 2020-07-02 03:35:09 -05:00
parent f51322a556
commit 17c62d6446
2 changed files with 9 additions and 1 deletions

View File

@ -105,6 +105,7 @@ const Sidebar = () => {
canNodeHaveChildren={(node) => !node.uri} canNodeHaveChildren={(node) => !node.uri}
generateNodeProps={({node}) => ({ generateNodeProps={({node}) => ({
onClick: (event) => { onClick: (event) => {
event.target.focus();
if (node.uri) { if (node.uri) {
dispatch(setActiveResourceUri(node.uri)); dispatch(setActiveResourceUri(node.uri));
} }
@ -124,6 +125,7 @@ const Sidebar = () => {
})); }));
} }
}, },
tabIndex: 0,
})} })}
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
onChange={(treeData) => setTreeData(treeData)} onChange={(treeData) => setTreeData(treeData)}

View File

@ -62,7 +62,13 @@ h2 {
.rstcustom__node { .rstcustom__node {
padding: 0 0.5em; padding: 0 0.5em;
&:hover { &:hover {
background-color: rgba(255, 255, 255, 0.025); background-color: rgba(102, 85, 255, 0.025);
}
&:focus-within {
background-color: #353e7d;
}
> :focus {
box-shadow: none;
} }
button { button {
top: 0.75em; top: 0.75em;