Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!