如果 bootstrap4 模态位于页面的低端,当点击模态内的输入字段时,它会滚动到底部(chrome android) [英] if bootstrap4 modals located low on the page, when tap on input field inside the modal, it scrolls to the bottom (chrome android)
问题描述
请看看这个问题.我有完整的一页简单的 html 代码来重现它.有两种模式 - 一种在顶部,一种在页面下方.模态内的输入字段.如果您点击输入字段,它会滚动到最底部,这样我就看不到输入字段.此问题仅出现在底部模态,而不是顶部模态.在 ANDROID 上使用 CHROME
代码如下:
<!doctype html><html lang="zh-cn"><头><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1,shrink-to-fit=no"><!-- Bootstrap CSS --><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcFAgWiGinAmAmFcFAGORIGINSIGINX"><title>你好,世界!</title>头部><身体><h4>嘿</h4><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal1">打开模态按钮><!-- 模态--><div class="modal" id="myModal1"><div class="modal-dialog"><div class="modal-content"><!-- 模态标题--><div class="modal-header"><h4 class="modal-title">模态标题</h4><button type="button" class="close" data-dismiss="modal">×</button>
<!-- 模态体--><div class="modal-body">模态体..<p>输入</p><输入类型=文本"><p>输入</p><输入类型=文本"><p>输入</p><输入类型=文本"><p>输入</p><输入类型=文本"><p>输入</p><输入类型=文本"><p>输入</p><输入类型=文本"><p>输入</p><输入类型=文本">
<!-- 模态页脚--><div class="modal-footer"><button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>