Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
418 views
in Technique[技术] by (71.8m points)

ios - Bootstrap 3 modal with long form on iPhone doesn't scroll if you touch input field

I'm using Bootstrap 3 and I have a long form that users will need to scroll to get to all of the fields. What is happening is if you touch an input field to start your scroll it just locks up. This doesn't happen on android phones.

I can't give you a link to my exact code, but if you go here and click the first demo on iphone you'll see what's happening: http://jschr.github.io/bootstrap-modal/

I'm not sure if there's some way to give those input fields some sore of touch event that allows the scroll or what. Any input would be helpful.

Also, the iphone simulator in xcode shows the same thing.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I fixed a very similar issue where the occasionally on iPhone, the background scrolls rather than the modal. Try disabling webkit smooth scrolling on the modal, and disabling all scrolling on the body when a modal is open

body.modal-open {
    position: fixed;
    overflow: hidden;
    left:0;
    right:0;
}
.modal{
    -webkit-overflow-scrolling: auto;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...