Skip to content

Open menu should support background scrolling #6927

Open
@trshafer

Description

@trshafer

Bug, feature request, or proposal:

Bug? Reading the source, when having a menu open, I believe the background should be able to be scrolled using the mouse. The background can be scrolled with the arrow keys.

What is the expected behavior?

The background can scroll.

What is the current behavior?

The background cannot scroll.

What are the steps to reproduce?

  1. Visit https://material.angular.io/components/menu/overview
  2. Open the menu by clicking the trigger: "Menu"
  3. Attempt to scroll the page (not the menu) using the mouse.

What is the use-case or motivation for changing an existing behavior?

A dialog box should block background scrolling, but the menu should not.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Current

Is there anything else we should know?

It is blocked by pointer-events: auto: https://github.com/angular/material2/blob/4d82f833c7e4a22814b8e225f05ef4ba01a86ad6/src/cdk/overlay/_overlay.scss#L61.
The menu does have the scroll strategy of reposition, which I believe should mean that the background should be able to be scrolled: https://github.com/angular/material2/blob/fe37cb2551929844d5467e1b9bf45032df35981f/src/lib/menu/menu-trigger.ts#L57

Activity

changed the title [-]Menu should support background scrolling[/-] [+]Open menu should support background scrolling[/+] on Sep 7, 2017
tinayuangao

tinayuangao commented on Sep 7, 2017

@tinayuangao
Contributor

@mmalerba Is this intended behavior?

jelbourn

jelbourn commented on Sep 8, 2017

@jelbourn
Member

This used to be the intended behavior (the backdrop blocking scrolling), but now they should reposition

added
P4A relatively minor issue that is not relevant to core functions
on Sep 8, 2017
crisbeto

crisbeto commented on Sep 9, 2017

@crisbeto
Member

This only really happens if the scrollable element is the sidenav container, not the body. @jelbourn it is a little tricky to solve, because we'd have to disable pointer events on the backdrop which breaks the clicking outside to close an overlay. It can be resolved by disabling pointer events and using a click handler on the document to determine whether the user clicked outside, but that can be problematic too because the user could stop the event from propagating all the way up.

added a commit that references this issue on Oct 13, 2017
6040d03
added a commit that references this issue on Nov 5, 2017
b52ee9a
added a commit that references this issue on May 8, 2018
737df91
added a commit that references this issue on May 20, 2018
0491a0f

19 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/menu

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @trshafer@jelbourn@crisbeto@zarend@Dam14n

      Issue actions

        Open menu should support background scrolling · Issue #6927 · angular/components