Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7614221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:20:55+00:00 2026-05-31T02:20:55+00:00

As the title suggests, I need a workaround to prevent mobile safari from scrolling

  • 0

As the title suggests, I need a workaround to prevent mobile safari from scrolling the document when a textarea is focused. The default behavior is to scroll the page so the textarea’s top is aligned with the top of the window. I just want my page to stay put. Is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:20:56+00:00Added an answer on May 31, 2026 at 2:20 am

    try with this

    // javascript.js
    var locked_scroll = false;
    var last_pos = 0;
    
    document.getElementById('my-text').addEventListener('focus', function(event){
        console.log('set locked');
        locked_scroll = true;
        last_pos = document.getElementById('wrapper').scrollTop
    });
    
    document.getElementById('my-text').addEventListener('blur', function(event){
        console.log('set unlocked');
        locked_scroll = false;
    });
    
    document.getElementById('wrapper').addEventListener("scroll", function(event){
    
        if(locked_scroll) {
            event.target.scrollTop = last_pos;
        }
    
    }, true);
    

    the event scroll only works when the element have a fixed height and the overflow property set to auto or scroll

    #wrapper {
        height: 300px;
        overflow: auto;    
    }
    

    check the example: http://jsfiddle.net/4YkNj/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the title suggests is it possible to execute another java app from within
Like the title suggests I need to do something like so... $i++;//we all know
As the title suggests I need a C# equivelant of ROUNDDOWN. For example, if
As the title suggests, I need to grant the execute permission on every stored
As the title suggests I would like to be able to use data from
As the title suggests, I need the ability to create, move, and delete files
As the title suggests, do we need force jvm to exit when get InterruptedException?
As the title suggests, I am in need of finding / creating a system
As the title suggests I need a way to match more than one zero
As you may see from the title, for some reason I need to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.