Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust CollapseButton focus styles. #4209

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions frontend/src/components/CollapseButton.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { withStyles } from '@material-ui/core';
import Button from '@material-ui/core/Button';
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
Expand All @@ -23,6 +24,7 @@ class CollapseButton extends React.Component {

render() {
const {
classes,
containerClass,
collapsed,
collapseUp,
Expand All @@ -34,7 +36,13 @@ class CollapseButton extends React.Component {

return (
<div className={containerClass}>
<Button onClick={onClick} size='small' color='inherit'>
<Button
classes={{ focusVisible: classes.focusVisible }}
onClick={onClick}
size='small'
color='inherit'
disableRipple
>
{currentLabel}
{collapsed ? (
collapseUp ? (
Expand All @@ -51,4 +59,10 @@ class CollapseButton extends React.Component {
}
}

export default CollapseButton;
const styles = () => ({
focusVisible: {
backgroundColor: 'rgba(0, 0, 0, 0.08)',
},
});

export default withStyles(styles)(CollapseButton);