scrollbar not appearing in Safari OSX

I have a side menu that slides in and out (utilizing Zurb Foundation). The overflow is set to auto so users can scroll through the menu if it extends beyond the screen.

This functionality is currently supported on these browsers:

  • Chrome
  • Firefox
  • Internet Explorer
  • Android Chrome
  • Safari iOS

However, it does not work as expected on Safari for OS X:
In this browser, the menu behaves as if its overflow property is set to hidden, preventing scrolling.

Below is the HTML structure of the menu:

<!-- Off Canvas Menu -->
        <aside class="right-off-canvas-menu">
            <ul class="side-nav" role="navigation" title="Main Navigation" onmouseover="this.title='';">
                [Menu items go here]
            </ul>
        </aside>

Additionally, here is the corresponding SASS code:

// Off Canvas Styling
// - - - - - - - - - - - - - -

.right-off-canvas-menu {
    height: 100%;
    max-height: 100vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

Answer №2

Try:

white-space:nowrap;
overflow: scroll;
-webkit-overflow-scrolling: touch;

Answer №3

After encountering a similar issue in my own project, I stumbled upon this question through a Google search. Unfortunately, the solutions provided here did not resolve the problem of the disappearing scroll bar for me. However, I found a helpful solution on this website that worked perfectly.

For anyone facing the same issue, you can customize the appearance of the scroll bar by adding the following CSS:

:root {
  --scrollbar-track-color: transparent;
  --scrollbar-color: rgba(0,0,0,.2);

  --scrollbar-size: .375rem;
  --scrollbar-minlength: 1.5rem; /* Minimum length of scrollbar thumb (width of horizontal, height of vertical) */
}
.right-off-canvas-menu::-webkit-scrollbar {
  height: var(--scrollbar-size);
  width: var(--scrollbar-size);
}
.right-off-canvas-menu::-webkit-scrollbar-track {
  background-color: var(--scrollbar-track-color);
}
.right-off-canvas-menu::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-color);
  /* Add :hover, :active as needed */
}
.right-off-canvas-menu::-webkit-scrollbar-thumb:vertical {
  min-height: var(--scrollbar-minlength);
}
.right-off-canvas-menu::-webkit-scrollbar-thumb:horizontal {
  min-width: var(--scrollbar-minlength);
}

Answer №4

For me, I found success by applying the property display (I used inline-block, but other options were effective too) to the child elements within the element.

Answer №5

There seems to be a problem that is specific to IOS, but we can focus on targeting Safari IOS specifically and apply CSS attributes like overflow: scroll; to resolve the issue.

 @supports (-webkit-touch-callout: none) {
           .classname{
                       white-space:nowrap;
                       overflow: scroll;
                       -webkit-overflow-scrolling: touch;  
                     }
                     }

Answer №6

There was a problem I encountered where certain pointer events were deactivated in Safari (the reason is still unknown). I managed to resolve this issue by including pointer-events:all in the scrolling container.

Answer №7

The problem persisted even after I had included the following code:

  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  white-space:nowrap;

In order to resolve this issue in Safari and enable scrolling in the div:

1- Make sure to use: overflow-y: scroll; rather than overflow-y: auto; as they produce different outcomes in Safari.

2- If you are setting a height for the div, avoid including overflow properties within it. Instead, create another nested div and apply overflow properties there like so:

HTML :

<div class="main"> 
  <div class=""scrollable> </div>
</div> 

CSS:

.main{
 height: 93vh;
}
. scrollable{
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}

Answer №8

While this question may be dated, it could still assist those facing similar issues:

In a situation where overflow-y: auto was causing the inability to scroll using the mouse wheel in macOS Safari, despite the scroll bar being visible and functional through dragging.

The remedy involved toggling the pointer-events property between two states (element denotes the scrollable DOM element):

element.style.setProperty('pointer-events', 'none');
setTimeout(() => {
      element.style.setProperty('pointer-events', 'auto');
    },
    0);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The alignment of justify-space-around and justify-content-center in Bootstrap 4 appears to be misaligned

I've been struggling to find a solution to this issue. My goal is to align the centered elements between two lines, similar to what Bootstrap's documentation shows. There doesn't appear to be any excess margin or padding causing alignment is ...

Choosing and transferring the table data to be shown in the pop-up box

Having encountered an issue with a popup trigger placed inside a td element, I am seeking advice on how to pass table data into the popup window. Unfortunately, the main popup window was positioned outside the while loop, resulting in multiple instances of ...

Align the dropdown menu in the center of every navigation item

A div of exact dimensions, measuring 800px wide and 50px tall, contains an unordered list of 6 elements that are centered within the div. The alignment is currently working as intended. My next goal is to create a dropdown list from each element. However, ...

What could be causing my hamburger icon to malfunction?

https://codepen.io/anon/pen/QNqgMo Curious why the top line of the animation isn't moving. Any code wizards out there who can spot the mistake? Appreciate it! #hamburger-icon.active .line-1 { transform: translateY(25px) translateX(0) rotate(45deg); ...

The top header must remain fixed at the top, while the bottom footer should stay fixed at the bottom of the page. The main div will then adjust to fill

My HTML code is structured using Bootstrap to create a grid layout. The goal is to have the NAV BAR and FOOTER contained within the left container, allowing the SIDEBAR on the right to display without overlapping. Here's an example image of what I&apo ...

As you scroll through the page, the menu gracefully descends alongside you

Having trouble with my menu navbar. Looking to make it stick to the top of the browser when scrolling down. Desired effect can be seen here: For residents, news, for tourists, about Gdynia, Any tips on how to modify my code to achieve this effect? Prev ...

Foundation Framework sidebar by Zurb

My current dilemma involves the zurb foundation framework, specifically with the .row class being set to a max-width of 61.25em, which is equivalent to 980px in width. The problem I am facing is that when I resize the browser and it reaches 1024px wide, t ...

Exploring the power of AngularJS through nested directives

Index.html: <nav-wrapper title="Email Test"> <nav-elem value="first"></nav-elem> <nav-elem value="second"></nav-elem> </nav-wrapper> app.js: app.directive('navWrapper', function() { return { ...

Buttons aligned vertically alongside an input text field

I am trying to align two buttons vertically under an input text box with the middle aligned. This is what I have done so far: jQuery(document).ready(function($) { // Implementing bootstrap minus and plus plugin // Reference: http://jsfiddle.net/lael ...

What is the best way to transfer a table row from one table to another in AngularJS?

I need assistance with a feature that allows users to move rows between tables by clicking on buttons. When the 'up' button is clicked, the 2nd table row should be moved to the 1st table, and when the 'down' button is clicked, the 1st t ...

Execute CGI upon the loading of the page

My goal is to achieve the following: When the HTML page loads, I want to execute a CGI script written in C to call a specific function. My current approach involves using a JavaScript function in the HTML: <body onload="MyJsFunc();"> Then, in th ...

The design of the page is structured around Semantic-UI Grid, and unfortunately, the spacing between elements cannot

Currently, I'm in the process of developing a web application with the help of semantic-ui. The primary objective is to design a layout that comprises a sidebar along with a main content area. Initially, I assumed that utilizing grid would be the most ...

Use the ng-repeat directive to display multiple items and let the user input a quantity for each item. Then, in AngularJs, gather all the form data, including the repeated items and their quantities, and

Hey there! I have a question related to AngularJs: How can I repeat pre-selected items using (ng-repeat) and allow users to enter a quantity for each item in a subsequent step, then submit all the form data? I'm wondering if adding $index to the repe ...

Creating a CSS background that adjusts to fit any screen resolution

Hey there, I'm a beginner to all of this. I want my background image to adjust to fit any web browser resolution, regardless of the size. So far, I've come across this nifty little trick: html { background: url(images/bg.jpg) no-repeat center ...

Tooltips experience issues when interacting with elements that do not utilize the :active state

$(function () { $('[data-toggle="tooltip"]').tooltip() }) <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" ...

Display a single div and conceal the rest upon clicking a link

Trying to find a way to hide all other divs when clicking on a navbar link to toggle them. Currently, the divs stay active when a new link is clicked. The goal is for them to slide up and the clicked one to slide down. <script type="text/javascript> ...

What could be causing the issue of not being able to load CSS files or images?

I'm currently in the process of learning how to develop websites, but I've encountered a stumbling block that I can't seem to overcome. I'm hoping someone here can help me out. I'm facing an issue where I am unable to link either a ...

How can I resize the border to match the size of the text inside it?

Check out the following image to see how it appears:https://i.sstatic.net/RkMqI.png Here is an example code snippet of a message: .allMsg { width: 100%; } .self { border-radius: 1rem; background-color: #28a745; text-align: right; padding-lef ...

When the browser's inner width is less than the inner height, use jQuery or JavaScript to show a message on the webpage

I've been having trouble getting this to work and I've attempted various solutions suggested by different sources such as: Display live width and height values on changing window resize php echo statement if screen is a certain size And more, b ...

"Adjust the width of a div element based on the unique ID of a

I am attempting to replicate a div multiple times, with each row in the database table creating a new instance. An example of what I'm aiming for is shown below. <?php for ($i=0; $i < 3; $i++) { ?><!-- replace '3' w ...