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

106
Vistas
How to prevent page scroll while scrolling options in dropdown?

I have an element dropdown with a vertical or horizontal overflow and when it reach the end of the scroll, the browser will start scrolling the parent element(scroll chaining).I want to prevent this default behaviour. I have tried following ways

overscroll-behavior: contain;

It has no browser support for safari.

Also use event.preventDefault() to prevent the default behavior so it blocks scrolling the page. We can’t prevent scrolling by using event.preventDefault() in onscroll listener, because it triggers after the scroll has already happened.

document.body.addEventListener('onscroll',function(e){
  e.preventDefault();});

I need a solution which also supports safari browser.

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