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

261
Vistas
Why does one of my Material UI autocomplete elements have a blue background for the options, but the other doesn't? (includes code sandbox)

FINAL EDIT: I ended up finding a fix and I updated my sandbox with it!

EDIT: I have determined that it is due to this line in the autocomplete...

isOptionEqualToValue={(option, value) => option.id === value.id}

However, if I try to change it to this...

isOptionEqualToValue={(option, value) => option.label === value.label}

I get the following error in the console...

useAutocomplete.js:219 MUI: The value provided to Autocomplete is invalid. None of the options match with "Lisinopril". You can use the isOptionEqualToValue prop to customize the equality test.


I have created the following form using Material UI and React Hook Form...

https://codesandbox.io/s/inputquestion-jyq5b?file=/src/App.js

I am very stumped on why the two autocomplete elements are styled differently with a light blue background for the options/the options' hovers, but the other one isn't.

Thanks in advance for any help you can provide!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Probably because the one with the disabledPortal prop is rendered inside the container (Box) with the applied style. The other one has the default disablePortal value set to false so it is rendered using react portal thus outside the Box. Try setting this prop the same and see if they are the same.

about 4 years ago · Juan Pablo Isaza Denunciar
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