material icon indicating copy to clipboard operation
material copied to clipboard

md-select does not scroll (loses focus) on safari

Open DmitryEfimenko opened this issue 11 years ago • 9 comments

after clicking on select and scrolling through options one or two times, the options container loses focus and I start scrolling through the page instead of select options.

It looks like this is more severe when <md-select> is inside an <md-toolbar> I took a video that shows described behavior.

tested on IOS 8.4.1

PS. and the color of select is off, but that's a minor.

DmitryEfimenko avatar Sep 15 '15 19:09 DmitryEfimenko

I had relatively hard time reproducing this on Plunkr, but finally I was able to do so. Here is the plunkr. However, make sure to see the issue in the "Preview Mode" You also might have to scroll up and down 5-6 times before it stops working.

DmitryEfimenko avatar Sep 15 '15 23:09 DmitryEfimenko

@DmitryEfimenko thanks for submitting this! Testing this on iOS 9.0.1 I am having trouble seeing the behavior. If I scroll on the body the select will indeed be temporarily unscrollable. However, if I stop for a moment (~1500ms) and then attempt to scroll the select, it will become scrollable again. Can you check if this behavior is true on iOS 8.4?

rschmukler avatar Sep 28 '15 16:09 rschmukler

I can reproduce the behavior you described on 8.3 (can't find 8.4 at the moment, but I assume it would be the same). It does happen every time. Looks like timing is very sensitive. If you do it too fast or too slow it might work as expected.

Also, would not it make sense to close drop down options if scroll event happens outside of it (for example on the body)? That would partially solve the issue. But also it would be a bandage on a problem rather than an actual solution.

DmitryEfimenko avatar Sep 28 '15 17:09 DmitryEfimenko

updated plunkr to use v0.11.1. It looks like select behaves better now. However, issue still can be reproduced in one condition:

  • open dropdown
  • start dragging the page (not the dropdown) - it's going to get dragged a bit off the screen)
  • release, and before page reaches its original position attempt to drag dropdown
  • observe that you are dragging the page rather than the dropdown

DmitryEfimenko avatar Oct 01 '15 21:10 DmitryEfimenko

This behavior is better still on RC1. Worth exploring closing on scroll from outside though.

rschmukler avatar Nov 04 '15 18:11 rschmukler

This is quite an important issue for mobile apps when used on a page which is scrollable. It's totally reproducible (visit the md-select demo page in Chrome/Safari on iOS), open a dropdown, attempt scrolling the page.

Currently it looks very undesirable because the absolute position means the page scrolls but leaves the md-select options in the same place.

I think the interaction should be reviewed for touch devices, and agree with @DmitryEfimenko that the dropdown should be closed as soon as the page detects a scroll event outside of the dropdown.

craiggoldstone avatar Jan 18 '16 10:01 craiggoldstone

Or even better, page scroll should be disabled when md-select is opened.
N.B. this is not Safari only

craiggoldstone avatar Jan 18 '16 10:01 craiggoldstone

+1 Experiencing the same problem on: Model: iPhone 6 Browser: Safari 9 mobile OS: iOS 9.3.1 and Model: iPad mini (ME279KN/A) Browser: Safari 9 mobile OS: iOS 9.3.1

Not an issue on: Model: Motorola Nexus 6 Browser: Chrome 49.0 OS: Android 5.1.1

Tested in Angular Material 1.1.0 (RC4).

Hammild avatar Apr 25 '16 10:04 Hammild

This issue is closed as part of our ‘Surge Focus on Material 2' efforts. For details, see our forum posting @ http://bit.ly/1UhZyWs.

ThomasBurleson avatar Jun 02 '16 13:06 ThomasBurleson