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

173
Visualizações
All keydown press stops in the keydown event except the tab key

In my react project, I have a scenario wherein the keyDown Event gets triggered on all the keyboard events except the tab event, when I press the tab it focuses on the next element that's there on the page.

Please check the screenshot.

Could you please advise why the tab press doesn't call the onKeyDown event but it does for any other key press?

Thanks

Click here to view the gif: Event get triggered on ArrowDown/w or any other keys except Tab

class CalendarDay extends React.Component {
  constructor(...args) {
    super(...args);

  }

  onKeyDown(day, e) {

  //***** DOESN'T GET TRIGGERED ON 'TAB' KEY PRESS

    const { onDayClick, onFoscusedTabKey, onKeyDownTabFocus } = this.props;
    const { key } = e;
    if (key === 'Enter' || key === ' ') {
      onDayClick(day, e);
    } else if (key === 'Tab' && !e.shiftKey) {
      onFoscusedTabKey(e);
    }

    onKeyDownTabFocus && onKeyDownTabFocus(e);
  }
  

  render() {
    const {
      ...
    } = this.props;


    return (
      <td
        role="link" // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
        ref={this.setButtonRef}
        aria-label={ariaLabel}
        onMouseEnter={onDayMouseEnterDebouncedCB}
        onMouseLeave={onDayMouseLeaveDebounceCB}
        onMouseUp={(e) => { e.currentTarget.blur(); }}
        onClick={(e) => { this.onDayClick(day, e); }}
        onKeyDown={(e) => { this.onKeyDown(day, e); }}
      >
        {renderDayContents ? renderDayContents(day, modifiers) : day.format('D')}
      </td>
    );
  }
}

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