Skip to content

Commit

Permalink
Merge pull request #26 from shreysachani/close-submenu
Browse files Browse the repository at this point in the history
Solved #23 Submenu stays open if not clicked and closed manually
  • Loading branch information
Chetan-KK authored Oct 21, 2024
2 parents b18b3ed + 28fd8b0 commit 5b9d246
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Components/StartMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,23 @@ export default function StartMenu(props) {
if (!ifBlurByStartMenuPress) {
if (isStartButtonActive) {
setStartMenu(prev => !prev)

setSettingsMenu(false)
setQuitMenu(false)
}
}
//close the power tab if it was opened
setQuitMenu(false)
}

function handleMouseLeave() {
setQuitMenu(false);
setSettingsMenu(false);
}

return (

<div data-testid="startMenuDiv" ref={startMenuDiv} onBlur={handleBlur} tabIndex="0" className={"StartMenu StartMenu" + props.active}>
<div className="flex options">
<div className="flex options" onMouseLeave={handleMouseLeave}>
<div className="opt"><i className="fa fa-bars"></i><span><b>Start</b></span></div>
<div className="bottom">

Expand Down

0 comments on commit 5b9d246

Please sign in to comment.