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

176
Vistas
Div scrolls to top when using onMouseEnter

I'm trying to get data of element on hover with reactjs, but when function starts div scrolls up to top, did someone got similar problem?

I used onMouseOver and onMouseEnter, i tried to save curent scrollTop value, but its glitchy.

My code sample, firstly i thought that there is a problem with rendering div with data, but even when its in position absolute bug occurs.

  const ListConteinder = () => {
    return (
      <div id="filtered-list">
            {filteredPosts.sort((a, b) => (a.name > b.name) ? 1 : -1).map((val, key) => {
              return (
                    <label id={val.ID} key={key} className="disable-select list-wrapper list-item" htmlFor={"list-item-" + val.ID} 
                    onMouseOver={(e) => {setDataID(e.target.id); showDetail(true)}}
                    onMouseLeave={() =>  showDetail(false)}>
                      <input type="checkbox" className="list-cb visually-hidden" name={val.ID} id={"list-item-" + val.ID} 
                      onChange={e => {setIsShown(false); handleChange(e)}}></input>
                      {val.name}
                    </label>
                )
            })}
          </div>
  )};
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