ionic-team / ionic-v1

The repo for Ionic 1.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
193 stars 187 forks source link

bug: Starting scroll on a label #184

Open jgw96 opened 7 years ago

jgw96 commented 7 years ago

From @Manduro on January 20, 2016 13:12

Type: bug

Ionic Version: 1.x

Platform: ios 9 browser

When scrolling starts on a label, the scroll is canceled. This occurs on iOS, haven't tested Android.

This problem is demonstrated in the following codepen: http://codepen.io/manduro/pen/vLpEzx/ (Open it on iOS or in Chrome device mode)

Copied from original issue: driftyco/ionic#5102

jgw96 commented 7 years ago

From @Invision70 on February 8, 2016 13:48

+1

jgw96 commented 7 years ago

From @DomClaxton on February 8, 2016 22:54

I can confirm this is an issue for me too. In browser using Chrome tools and switching to touch device view. Also in IOS 8.1.3 (iPhone4s). Both instances have the form element in a modal. I can only scroll the content 'between' the range element. If your finger registers a 'hit' on top of the range then scrolling ceases. Have tried using native scrolling too - no joy.

jgw96 commented 7 years ago

From @tomasbedrich on February 15, 2016 13:30

I think it may be an issue in a function tapTargetElement, because label.control returns the labeled <input> even if the <label> doesn't wrap it – according to HTML5 specs. On the other hand, ele.querySelector returns only the <input> which is inside the <label> tag (source).

But I don't get the point of this condition at all (even after reading the comments – what does it mean to "ugly auto scroll"?).

The simplest solution which worked for me was to remove the condition mentioned above. Since then I haven't discovered any cons of this solution.

jgw96 commented 7 years ago

From @Manduro on February 29, 2016 22:3

For @tomasbedrich and others running in to this: the easy fix for me was to replace all <label>'s with regular <div>'s. The downside to this is of course not being able to focus the input by tapping the label. In my case I only use a placeholder, not a real label, so it isn't much of a problem.