Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
When clicking on Profile icon with enabled scroll bar the nav elements shift to the left

I am using MUI Menu to open and close Menu when clicking on profile pick, the problem is, if you make "Scroll bar" enabled in the computer setting and click on the icon, it shifts to the left on the size of scroll bar.

Any idea how to stop this "jumping" behaviour when clicking the Menu icon?

Thanks!

Before opening the menu After opening

That what I have in .tsx file:

<>
<button ref={anchorRef} className={styles.LogoutButton} aria-controls={'menu'} onClick={handleOpenAccount}>
    <AssignmentIndOutlinedIcon style={{ width: 28, height: 28, color: Colors.Grey700 }}/>
</button>
<Menu id={'menu'}
      anchorEl={anchorRef.current}
      open={Boolean(openMenu)}
      onClose={handleCloseAccount}
>
    <div className={styles.container}>
        <MenuList className={styles.nameField}>{`${user?.firstName} ${user?.lastName}`}</MenuList>
        <MenuList className={styles.emailField}>{user?.email}</MenuList>
        <Divider className={styles.divider} variant={'fullWidth'}/>
        <MenuItem  className={styles.menuItem} onClick={redirectToUserAccount}>
            <Text className={styles.text}>{strings.view_account}</Text>
        </MenuItem>
        <MenuItem className={styles.menuItem} onClick={logoutClick}>
            <Text className={styles.text}>{strings.log_out}</Text>
        </MenuItem>
    </div>
</Menu>
</>

and CSS:

.container {
  padding: p.$SPACING p.$SPACING * 1.5 p.$SPACING p.$SPACING * 3;
  text-align: end;

  .nameField {
    margin-top: p.$SPACING * 1.5;
    font-size: large;
  }

  .emailField {
    color: p.$GREY;
    margin-top: p.$SPACING;
    font-size: medium;
  }

  .divider {
    margin-top: p.$SPACING * 2;
    margin-bottom: p.$SPACING;
  }

  .menuItem {
    padding-right: 5px;
    border-radius: 5px;
    justify-content: flex-end;
    .text {
      line-height: p.$SPACING * 2;
    }
  }

}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!