Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda