Skip to content

Commit

Permalink
For Palette category use onHeadingClick on Accordion to enable keyboa…
Browse files Browse the repository at this point in the history
…rd click

Signed-off-by: srikant <[email protected]>
  • Loading branch information
srikant-ch5 committed Feb 23, 2024
1 parent 3b4130b commit dc34aa8
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ class PaletteFlyoutContentCategory extends React.Component {
constructor(props) {
super(props);

this.state = {
et: {}
};

this.onMouseOver = this.onMouseOver.bind(this);
this.onMouseLeave = this.onMouseLeave.bind(this);
this.categoryClicked = this.categoryClicked.bind(this);
this.accRef = React.createRef();
}

onMouseOver(ev) {
Expand Down Expand Up @@ -98,7 +103,13 @@ class PaletteFlyoutContentCategory extends React.Component {
const titleObj = this.getTitleObj();
const content = this.getContent();
return (
<AccordionItem title={titleObj} open={this.props.category.is_open} onClick={this.categoryClicked}>
<AccordionItem title={titleObj} open={this.props.category.is_open}
onHeadingClick={() => {
if (this.accRef?.current) {
this.accRef.current.click();
}
}}
>
{content}
</AccordionItem>
);
Expand All @@ -115,6 +126,7 @@ class PaletteFlyoutContentCategory extends React.Component {
value={this.props.category.label}
onMouseOver={this.onMouseOver}
onMouseLeave={this.onMouseLeave}
ref={this.accRef}
>
<div className="palette-flyout-category-item">
{itemImage}
Expand Down

0 comments on commit dc34aa8

Please sign in to comment.