angular / material

Material design for AngularJS
https://material.angularjs.org/
MIT License
16.55k stars 3.39k forks source link

select: default scroll position incorrect when using md-select-header #10561

Open bunjiboys opened 7 years ago

bunjiboys commented 7 years ago

Actual Behavior:

CodePen (or steps to reproduce the issue): *

AngularJS Versions: *

Additional Information:


Shortcut to create a new CodePen Demo. Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions. Add more lines if needed.

markwpiper commented 7 years ago

+1

It's possible to work around this by setting the .scrollTop of the md-content inside the md-select-menu, on a delay triggered by md-on-open.

Coffeescript workaround:

scope.onOpen = ()->
  opened = false
  scrollSelectHeaderInView = ->
    el = $("md-select-menu md-content._md")
    if !opened && el.length > 0
      opened = true
      el[0].scrollTop = 0
  $interval(scrollSelectHeaderInView, 40, 10, false)
  opened
alonetech commented 6 years ago

for ios put the below css :

md-select-menu md-content {
    -webkit-overflow-scrolling: auto !important;
}
Splaktar commented 6 years ago

This is reproducible with AngularJS Material 1.1.7 and AngularJS 1.6.7 as well.

Splaktar commented 5 years ago

@srikanthdarmapuri please 👍 the OP so that we can sort by popular issue reactions. Please refrain from adding +1 comments to issues.

rishabh19991 commented 4 years ago

I also faced the same issue, and here is my workaround using jQuery $('md-select-menu md-content._md').scrollTop(-10);

Waiting for some proper solution.