Angular Material's md-content utilizes its own vertical scroll bar

Struggling with a problem while using Angular 1.* and angular-material.

The issue arises when dealing with views that plug into <div ng-view></div> and md-content. If the height of the view exceeds the viewport, it leads to the appearance of two vertical scroll bars side by side.

While it is possible to use overflow-y: hidden on the md-content, I am looking for a solution where the view extends the viewport horizontally only utilizing the outer scroll bar.

<body ng-app="app">
     <md-toolbar class='md-medium-tall'>
       <div class="main-title">
         <img src="./images/yo-small.png">
         <p class="top-title">foo</p>
         <h5>Bar</h5>
       </div>
     </md-toolbar>

     <div class="menu-container" layout="row">
        <md-sidenav
          md-is-locked-open="$mdMedia('min-width: 900px')" 
          class="md-sidenav-left"
          md-whiteframe="0">

          <md-menu-content>
            <md-menu-item>
              <md-button href="#ppv">
                <md-icon class="material-icons" menu-align-target="">assessment</md-icon>
                  PPV</button>
            </md-menu-item>
          </md-menu-content>

        </md-sidenav>

        <md-content>
          <div ng-view></div>
        </md-content>
     </div>
  </body>

<div style="height: 1000px; width: 800px ">
  <h1>mom</h1>
</div>

https://i.sstatic.net/TzzTZ.png

UPDATE: Managed to come up with a workaround for this issue. Any ideas on how to make it work smoothly?

md-content {
  overflow-y: hidden;
}

angular.module('app')
  .controller('PPVCtrl', ['$scope', function($scope) {


    // fix for angular-material responsive issue
    document.body.style.height = "800px";
    $scope.$on('$destroy', function() {
      document.body.style.height = "100%";
    });
  }]);

Answer №1

The expected behavior here is that the mdContent directive functions as a block element designed for scrollable content with its own scrollbar. It should be utilized specifically in cases where nested scrolling is needed, such as in dialogs, sidebars, and bottom sheet elements.

For more information on the mdContent directive, you can visit the official documentation.

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

Adjust the select box size to be in line with the text box dimensions

I'm struggling to understand why there are two boxes visible in my navigation bar. For example, when looking at the Home link, I notice that there are actually two boxes; one containing the text "Home" and another one that extends outwards to the rig ...

What issues could arise from utilizing PHP for generating variables within my CSS file?

One major limitation of CSS is the absence of variables. It would be beneficial to have the ability to use variables for controlling things like the location of imported CSS and color schemes within a design. An alternative solution could involve using a ...

Guide to updating the button's color when clicked

I need to change the color of an iconic button when it is clicked. The default color is the primary color, but when the button is clicked, it should change to red. This functionality is working correctly. After clicking the button, two hidden buttons shoul ...

Is there a way to align the Title in the Titlebar to the center?

Hi there! I could use some assistance :) I have an Electron app and I'm working on the title bar. I would like to center the title, but I'm not sure how to do it. Can anyone provide guidance on this? Also, since I am a beginner, I'm unsure i ...

Restangular will maintain the Http Content-Type as it is

I encountered an issue while trying to send a file as part of my form. Despite changing the content type to "multipart/form-data", the console still indicates that it is using application/json;charset=utf-8. As a result, Node.js (with Sails.js framework) t ...

How can I adjust a large image to fit the browser window using CSS?

I have a large image (3000px by 2000px) that I want to use as the background for my website and adjust it to fit the window size. Currently, I have implemented the following CSS: body { background: url('image.jpg') !important; background ...

Having trouble activating the Tailwind CSS or Intellisense features

I'm having trouble getting my React app to properly style divs using Tailwind CSS. The intellisense feature doesn't suggest any styling options for me either. import './App.css'; function App() { return ( <div className="t ...

Adaptive Container with Images that are not stretched to full width

Is there a way to achieve the same effect as seen in images 2 and 3 here: Although these images already have their own "padding," I'm curious if it can be replicated using just jQuery and CSS? I would appreciate any help or insights on this. Thank y ...

An AngularJs library designed for storing data

Is there a library similar to Ember Js and Persistence for AngularJs, or is it in the works? Maybe there is a framework-independent solution available? What I am looking for is a library that can: Define my object model Establish relationships between m ...

In order for the Facebook share button to appear, a page reload is required when using Angular

I've been working on integrating Facebook's share plugin, but I've encountered an issue where the share button only shows up after reloading the page. If I navigate to the page through a link or URL, the button doesn't appear until afte ...

Several dropdown menus within the same container, working independently of each other

I recently encountered an issue with a drop-down navigation bar. When I have multiple drop-downs and click on one, it opens as expected. However, if I then proceed to click on another drop-down while the first one is already open, both of them remain open ...

Warning: Angular JS encountered a [$injector:modulerr] error

I'm currently working on developing an application using the MEAN stack. Here is a snippet of my controller code: var myApp = angular.module('myApp',[]); myApp.controller('AppCtrl',['$scope', '$http', function( ...

Is AngularJS Experiencing Bugs with the Webcam getUserMedia API?

I recently created a webcam directive in AngularJS that utilizes a service. For reference, I followed this example: Surprisingly, the example works perfectly on my tablet, but when I integrate the code into my tablet's Google Chrome browser, it encou ...

Check if the data-indices of several div elements are in sequential order using a jQuery function

Is there a way to implement a function in jQuery-ui that checks the order of div elements with data-index when a submit button is pressed? I have set up a sortable feature using jQuery-ui, allowing users to rearrange the order of the divs. Here is an exam ...

Should the max-height transition be set from 0 to automatically adjust or to none?

I'm dealing with an element that has a max-height of 0, and I want to smoothly transition it to either no max-height, auto, or none; essentially allowing it to expand based on the number of elements inside. I prefer not to use JavaScript or flex at th ...

Angular.js has a unique filter that allows users to customize the date format to their preference

My upcoming event is happening on "endDate": "2014-11-30 01:00:00.0", in JSON format. I want to display it as 30 Nov 2014. I attempted to display it using: {{ phone.endDate | date:'medium' }} within an HTML document. Unfortunately, it is sti ...

My webpage lacks responsiveness

I've recently put together an HTML page, but unfortunately, it's not responsive. My Code <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> ...

Issues with Twitter Bootstrap Tabs not functioning correctly on Ruby on Rails with HAML

I am facing an issue with twitter bootstrap tabs in my (HAML) ruby on rails project. Although the tabs are appearing, the content does not change when I click on different tabs. Additionally, some unexpected statements are showing up at the bottom of the f ...

Personalized directive for HTTP validation, display dialog box upon detection of incomplete match

Looking to validate input against a server-side REST API and provide options for selection if invalid while typing. Already implemented in jQuery, now looking to implement in AngularJS. Would it be better as a custom directive or functions in the controll ...

What could be causing this Ajax error I'm experiencing?

I am attempting to dynamically load pages on this website using JQuery and Ajax when a menu point is clicked. However, I am encountering errors during the loading process. What does the console message ""GET 'path to css file'" mean? (there ...