Skip to content

Overlay-based components should handle page scroll gracefully #4093

Closed

Description

@jelbourn

Creating this issue to track this problem for menu, tooltip, select, autocomplete, datepicker, dialog, snackbar.

Approach we will be taking:

  • Default behavior will be to reposition the overlay on scroll using the ScrollDispatcher
  • Behavior can be changed to disable scrolling instead on a strictly opt-in basis
  • Implementation of scroll-blocking must be overridable by end-user

Activity

  1. added
    P2
    on Apr 13, 2017
  2. sabithpocker commented on May 8, 2017

    @sabithpocker

    Auto complete overlayed dropdown position is not updated on scroll.

  3. sabithpocker commented on May 12, 2017

    @sabithpocker

    Autocomplete does support repositioning upon resize / scroll. But not when dropdown list items change and there by height of dropdown.
    Also why is the position dependent on height of dropdown? it can be accommodated above/below just based on availability of space? Or is there a priority to show it below?

    Consider a case where one option is already entered("png-alpha" in screenshot). Now when focus is back in the input there is just enough space below the control to show one option(already selected one) and it fits in.

    screen shot 2017-05-12 at 3 22 20 pm

    Figure 1: single item accommodated in just-enough-space

    But if we delete couple of characters from the input text, more options showup but doesn't update position to above neither does it allow to scroll beyond document height.

    screen shot 2017-05-12 at 3 26 28 pm

    Figure 2: broadening search critereon brings in more items but not accessible via scroll/neither does it reposition

    If I do a scroll or blur/focus-back the repositioning is triggered correctly, but not upon change in "input text" or "dropdown-list" length.
    screen shot 2017-05-12 at 3 30 31 pm
    _Figure 3: clicking out to blur and focusing in back fixes the issue and triggers repositioning _

    This can be fixed by either of the following in my opinion:
    1. Updating position when input text changes along with scroll, which might eat up performance.
    2. Make position(above/below) irrespective of height of dropdown and only based on proximity of input element to screen edges. This way figure 1 should show the options above irrespective of the fact that it can be accommodated below.

    using master "@angular/material": "git+https://github.com/angular/material2-builds.git"

  4. crisbeto commented on May 12, 2017

    @crisbeto
    Member

    #4469 will reposition the autocomplete panel when the amount of items changes.

  5. sudheeshcm commented on May 24, 2017

    @sudheeshcm

    @crisbeto @jelbourn
    Isn't this fix merged in the latest beta version(2.0.0-beta.5). It works in the example provided.
    Still my autocomplete options scrolls with the page.

    If not please let me know, how to include those changes.

    Thanks,
    Sudheesh

  6. Zefling commented on May 24, 2017

    @Zefling

    @sudheeshcm Are you in this case : #4557 ?

  7. sudheeshcm commented on May 25, 2017

    @sudheeshcm

    @Zefling I'm not exactly sure. Tried removing all the "overflow: auto" styles, and still have this issue.

  8. 5 remaining items

  9. added a commit that references this issue on Jun 14, 2017
    7d682fd
  10. added 4 commits that reference this issue on Jun 15, 2017
    b89d167
    d4c73e5
    778ca51
    7b169e8
  11. added a commit that references this issue on Jul 6, 2017
    bbd1ca4
  12. added 3 commits that reference this issue on Jul 8, 2017
    fc7823d
    5bad898
    100e123
  13. added a commit that references this issue on Jul 17, 2017
    184a6e4
  14. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  15. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions