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

156
Visualizações
Multiple select component doesn't return updated selected values onChange

React (and JS ad web-development) newbie here.

I'm using react-select to build a filter box on the sidebar of a web map. The goal is that when I apply several filters (there's a checkbox and two multiple selection dropdown menus at the moment) the data on the map get updated accordingly.

The problem is that when I get the selected value through onChange, it seems I get the old options.

Example: a, b, c selected on the dropdown, I get a, b in the console.log.

So my filter function cannot use updated values.

If I use the DOM (through document.getElementsByName), I receive a NodeList which is off-by-one when I try to convert to an array (it loses the last selected option somehow...); If I use the event on handleChange, I don't get a representation of the event but just the values (this is problematic because I have several filters and each triggers the handleChange so I need to know which menu triggered the event).

I know I've not been crystal clear, but any hint would be appreciated since I'm really stuck. Thanks a lot.

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