Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda