问题
My mobile website has a fixed scrollable (overflow-y:auto
) element that contains input
tags. On iPhone and iPad, touching and moving on the input
tags block the element from scrolling but touching and moving on labels (or anything else) do not. This issue does not occur on Android.
The input
tags used to be part of a table
before I switched to div
s for layout and the scrolling worked then for iOS and Android. Is there a reason why scrolling is blocked when the input
tags are not in table
s? I really prefer not having to go back to table
s for layout.
I also tried -webkit-overflow-scrolling: touch
and it fixed the issue for iPhone but prevents scrolling completely on iPad on top of allowing users to scroll horizontally which I don't want.
UPDATE: If the soft keyboard is active everything works as intended. Only when the keyboard is not active when I get the issue.
回答1:
The problem could be the browser. Do you use safari or another browser? Maybe updating the browser or trying it on a different iOS device will work?
来源:https://stackoverflow.com/questions/14333410/ios-html-input-tag-stops-scrolling-in-scrollable-element